Re: Sending a large file - WeOnlyDo Discussion board

Re: Sending a large file (General questions)

by Simon, Wednesday, September 27, 2006, 10:42 (6423 days ago) @ wodDamir

Ok, I'm a little further now.

How do I know when sendChunk completes the send of the current packet?

Here is what I want to do:
I have a file that is slowly being generated.
I need to stream that file as it is being created.

For now, I'm having trouble streaming the file to the user's browser.

I am using sendChunk. After I send all the data, (4 MB) the browser only gets a 300 KB file.
I think the problem is sometimes the data is sendChunked too quickly to be processed by the webserver control and so its discarded.

I have set the following header info:
[code]
User.Response.Headers.Add Content-Type , binary/octet-stream
User.Response.Headers.Add Content-Length , 4325448
User.Response.Headers.Add Content-Disposition , filename= + fi _
+ ; size=4325448
[/code]

I then send the data little by little using a timer that goes off once every 250 ms:

user.Response.sendChunk (fdata)

I can't use User.UploadBytes because that includes the chunk header information.


Complete thread: