File download size limit

G

Guest

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. Below is the code I am using for the download.


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();


Any assistance on this will be greatly appreciated. Tim
 
J

Joerg Jooss

Thus wrote 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. Below is the code I
am using for the download.

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();
Any assistance on this will be greatly appreciated. Tim

Try using Response.TransmitFile() instead of WriteFile(). TransmitFile()
doesn't buffer the file.

Cheers,
 
G

Guest

That did the trick, Thanks
Tim

Joerg Jooss said:
Thus wrote tjfdownsouth,


Try using Response.TransmitFile() instead of WriteFile(). TransmitFile()
doesn't buffer the file.

Cheers,
 

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

Top