Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Writing a file to output using Response.BinaryWrite?

Reply
Thread Tools

Writing a file to output using Response.BinaryWrite?

 
 
Chris Ashley
Guest
Posts: n/a
 
      10-02-2007
I have a stream of bytes (making up a large file) coming from
somewhere, and need to send it to the user. I can't send it to
Response.OutputStream because this is read only, and storing the
entire file in memory and then outputting that isn't really an option
as the files are in excess of 200mb each. I am considering having a
loop, and reading the stream and creating a buffer byte array every
100kb or so, and then using Response.BinaryWrite to send this to the
user - will this work if I set buffer to false and set the headers/
contenttype correctly (IE: User gets file download box, and as they
download my loop runs sending the bytes through), or will the user
just see junk?

 
Reply With Quote
 
 
 
 
bruce barker
Guest
Posts: n/a
 
      10-02-2007
your approach is correct.

-- bruce (sqlwork.com)



Chris Ashley wrote:
> I have a stream of bytes (making up a large file) coming from
> somewhere, and need to send it to the user. I can't send it to
> Response.OutputStream because this is read only, and storing the
> entire file in memory and then outputting that isn't really an option
> as the files are in excess of 200mb each. I am considering having a
> loop, and reading the stream and creating a buffer byte array every
> 100kb or so, and then using Response.BinaryWrite to send this to the
> user - will this work if I set buffer to false and set the headers/
> contenttype correctly (IE: User gets file download box, and as they
> download my loop runs sending the bytes through), or will the user
> just see junk?
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Newbie help: File searching and writing output to new file drew Ruby 6 10-28-2005 04:04 AM
Any problems with writing the information into a file - Multi-users perform writing the same file at the same time ???? HNguyen ASP .Net 4 12-21-2004 01:53 PM
Newbie: How do I filter output to the screen and writing the orginal output to a file? Mav Perl Misc 22 07-09-2004 09:56 PM
Problem writing output result to text file Lily VHDL 1 05-19-2004 03:34 PM
Writing JSP output to file Mike Java 2 02-24-2004 09:13 AM



Advertisments