B
blantz
I am using Forms Authentication to force a login to a support folder,
where there are large .exe and .zip files for download. In my
web.config file, i am blocking these file extensions with a
httpHandler
<httpHandlers>
<add verb="*" path="*.exe" type="MyHandler.NewHandler,httpHandler"/>
<add verb="*" path="*.zip" type="MyHandler.NewHandler,httpHandler"/>
</httpHandlers>
The code that downloads the files in the handler is...
string strFileName =
context.Request.MapPath(context.Request.ServerVariables["PATH_INFO"]);
FileInfo myFile = new FileInfo(strFileName);
objResponse.AddHeader("Content-Disposition","attachment; filename=" +
myFile.Name);
objResponse.ContentType = "application/octet-stream";
objResponse.TransmitFile(myFile.Name);
objResponse.Flush();
objResponse.End();
My problem is that when you are downloading a file, part way through
an error message appears saying, "The connection with the server has
been reset" or the file will seem to have downloaded correct, but only
40 or 50 mb's have been downloaded.
I thought it may be a timeout issue, so i made this change to the
web.config file... nothing changed though.
<system.web>
<httpRuntime executionTimeout="36000" />
</system.web>
where there are large .exe and .zip files for download. In my
web.config file, i am blocking these file extensions with a
httpHandler
<httpHandlers>
<add verb="*" path="*.exe" type="MyHandler.NewHandler,httpHandler"/>
<add verb="*" path="*.zip" type="MyHandler.NewHandler,httpHandler"/>
</httpHandlers>
The code that downloads the files in the handler is...
string strFileName =
context.Request.MapPath(context.Request.ServerVariables["PATH_INFO"]);
FileInfo myFile = new FileInfo(strFileName);
objResponse.AddHeader("Content-Disposition","attachment; filename=" +
myFile.Name);
objResponse.ContentType = "application/octet-stream";
objResponse.TransmitFile(myFile.Name);
objResponse.Flush();
objResponse.End();
My problem is that when you are downloading a file, part way through
an error message appears saying, "The connection with the server has
been reset" or the file will seem to have downloaded correct, but only
40 or 50 mb's have been downloaded.
I thought it may be a timeout issue, so i made this change to the
web.config file... nothing changed though.
<system.web>
<httpRuntime executionTimeout="36000" />
</system.web>