File Download ends incomplete..500 points..
Posted on 2008-02-06
I have a ASP .NET web page which downloads files..It is working perfectly for small & average sized files..But when I download a large file (17MB file for instance) it starts the download well, but after 2 minutes or so (after downloading about 6MB) it just finishes. The downloaded file is incomplete. Why is this happening and how can I troubleshoot this?
My download code is given below.
FileInfo file = null;
string filename = null;
// get the fully qualified name of the selected file
filename = utils.Utils.GetDownloadsArea() + m_filename;
// get the file data since the length is required for the download
file = new FileInfo(filename);
// write it to the browser
"attachment; filename=" + file.Name);
Response.ContentType = "application/octet-stream";
Anything wrong or suspicious about this code snippet? What other reasons could cause a file download problem?