开发者

Getting Request timed out error when uploading large files

We have page that allows the users to upload documents (multiple). When the upload takes a long time - either due to the size of the files or due to slow upload speeds - we get a exception saying "Request timed out".

We found that the exception is thrown as soon as the upload is complete. So 开发者_如何学JAVAwe have modified the executionTimeout config entry to 6000 secs. But this error still shows up consistently.

We are running IIS6, .net 3.5 sp1 (asp .net 2.0).


Update

I'm able to reproduce this issue with relatively small files (multiple files with total of 75MB)


I can't explain it any better than Jon Galloway has, so I won't try :)

Basically there are a lot of forces fighting against you when trying to upload large files via HTTP. The moral of the story is this:

Using a regular upload methods is not adequate for large files. Instead you should be using a separate method that is designed specifically for large files.


Maybe you should set form to accept multipart data.


By upload, I presume you mean through a .aspx page. You need to set the the following:

Server.ScriptTimeout = 9000 'Time in seconds

Note that this value is server-wide, so you should store the old value somewhere and reset it back to its original value when the upload completes.

http://msdn.microsoft.com/en-us/library/ms524831(VS.90).aspx


try this < httpRuntime maxRequestLength="Maximum size you want to upload in KB" executionTimeout="No. of seconds for Execution Time Out" /> in web.config

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜