Note that there are some explanatory texts on larger screens.

plurals
  1. POConfiguring httpRuntime execution timeout for large downloads
    primarykey
    data
    text
    <p>At my place of work, we have an ASP.NET page that uses the following code to perform a file download. We use this rather than Request.TransmitFile() because the file is coming directly from a zip archive.</p> <pre><code> private void DownloadStream(Stream stream) { int bytesRead; int chunkSize = 1048576; //1MB byte[] readBuffer = new byte[chunkSize]; while ( (bytesRead = stream.Read(readBuffer, 0, readBuffer.Length)) &gt; 0) { if (!Response.IsClientConnected) break; Response.OutputStream.Write(readBuffer, 0, bytesRead); Response.Flush(); } } </code></pre> <p>I'm trying to determine a reasonable value for the httpRuntime executionTimeout setting. The files being sent range up to 1GB in size, and some of our users have very slow pipes<sup>*</sup> to the webserver (think 64K lines). We don't want these users to experience connection resets. However, we want to keep a reasonable timeout value for the rest of the site. </p> <p>Is there a way to define an executionTimeout setting <i>only</i> for this specific page (or even make it unlimited for that page specifically)? What's the recommended approach? I know we'd probably be better off using a totally different method to serve the files (e.g. FTP), but we don't have the freedom to make that choice. All we can do is modify the code for the site.</p> <p>Also, I <i>do</i> think these downloads should be compressed before sending, but that's another matter.</p> <p>*Off-topic question: Is "slow pipe" an annoyingly mixed metaphor? I should probably say "small pipe" instead, but that sounds strange to me in this context. Opinions?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload