File download size limit

T

tjfdownsouth

I have a site that allows a person to log in and get a list of files to
download for them. If the file size is under 65MB then everything is fine,
they click the download button and the save box pops up. But if the file is
larger than 65MB the page sits and processes until it times out. I can't
figure it out becaus a 64MB file loads immediately for download while one
slightly larger hangs up.

Any assistance on this will be greatly appreciated. Tim
 
A

Anthony Jones

tjfdownsouth said:
I have a site that allows a person to log in and get a list of files to
download for them. If the file size is under 65MB then everything is fine,
they click the download button and the save box pops up. But if the file is
larger than 65MB the page sits and processes until it times out. I can't
figure it out becaus a 64MB file loads immediately for download while one
slightly larger hangs up.

Any assistance on this will be greatly appreciated. Tim

Is the link to the file supplied a direct URL for the file in a web folder
or is it a link to an ASP page which streams the file content to the client.

If the latter then it may be a buffer size limit. You could increase the
buffer limit but the real solution would be to code the ASP to allow the
file to be streamed properly rather than being buffered. This involves two
things: make sure Response.Buffer = False and don't use BinaryWrite to send
the whole contents of the file at once.
 
T

tjfdownsouth

This is the code I am using to download the file when a user click the
download button:

FileInfo targetFile = new FileInfo(filePath);
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment; filename=" +
targetFile.Name);
Response.AddHeader("Content_Length", targetFile.Length.ToString());
Response.ContentType = "application/octet-stream";
Response.WriteFile(targetFile.FullName);
Response.End();
 
A

Anthony Jones

tjfdownsouth said:
This is the code I am using to download the file when a user click the
download button:

FileInfo targetFile = new FileInfo(filePath);
Response.Clear();
Response.AddHeader("Content-Disposition", "attachment; filename=" +
targetFile.Length.ToString());
Response.ContentType = "application/octet-stream";
Response.WriteFile(targetFile.FullName);
Response.End();

WriteFile is a member of HttpResponse in ASP.NET. You've posted to a
Classic ASP NG.

However it does sound like you are exceeding the server buffer. Replace
Response.Clear() with Response.Buffer = False.
 
T

tjfdownsouth

Anthony I tried your suggestion and it is still having trouble, it is not
having an error but it still does not operate the same. If the file is less
than 65MB it immediately pops up a dialog if it is more it just sits there
processing. Thanks for your help I will try in the .net forum also.

Tim
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top