Setting httpRuntime runtime for large downloads

At my place of work, we have an ASP.NET page that uses the following code to download a file. We use this, not Request.TransmitFile (), because the file comes directly from the zip archive.

    private void DownloadStream(Stream stream)
    {
        int bytesRead;
        int chunkSize = 1048576; //1MB
        byte[] readBuffer = new byte[chunkSize];

        while ( (bytesRead = stream.Read(readBuffer, 0, readBuffer.Length)) > 0)
        {
            if (!Response.IsClientConnected)
                break;

            Response.OutputStream.Write(readBuffer, 0, bytesRead);
            Response.Flush();
        }
    }

I am trying to determine a reasonable value for the httpRuntime executionTimeout parameter. Sent files are up to 1 GB in size, and some of our users have very slow channels * for the web server (I think 64K lines). We do not want these users to experience a connection failure. However, we want to maintain a reasonable timeout value for the rest of the site.

executeTimeout only ( )? ? , , , (, FTP), . , , .

, do , , .

* : " " ? , " ", . ?

+3

Source: https://habr.com/ru/post/1731615/


All Articles