does ExecutionTimeout include file upload time?

A

Andy Fish

Hi,

I am trying to investigate a problem reported by one of my users who
received a "System.Web.HttpException: Request timed out." error trying to
upload a large file into my asp.net 2.0 application.

I have seen several blog posts and other articles implying that the
ExecutionTimeout property includes the time taken to upload the file,
whereas I had been of the opinion that the execution timeout only started
ticking once the entire request had been received by the server, and my
recent experiments would seem to back this up.

Can anyone throw any light on this?

Andy
 
A

Andy Fish

ok I have done some more experiments and it seems that the execution timeout
does indeed include the time to upload the file

I would like to allow the user to upload large files if required, but I do
not want to just set the global ExecutionTimeout to some massiv value
because I think the default value is sensible for all other requests.

Is there any way to set the execution timeout differently on different
pages? or to override it programmatically for an individual HttpRequest
object ?

TIA

Andy
 
P

Patrice

Try but AFAIK in classic ASP, the Server.ScriptTimeOut was initialized for
each request with the IIS default value. Changes to this value were only
valid for the duration of the current request.

Just try to set the value in page A and display the value in page B to
confirm (or not) that the behavior is the same in ASP.NET...
 
P

Patrice

Have you tried ? Could it be something such as :
- the timeout is taken from the IIS application configuration
- you can still change this value programmatically ?
 
P

Patrice

I make a quick test and it looks like :
- Server.ScripTimeOut is initialized to a default value with each request
- I'm able to change the value programmatically even when debug is false

So you should be able to change this value just in the upload page. It will
still have the default value in all other pages...
 
B

Ben Schwehn

http://msdn2.microsoft.com/en-us/library/system.web.httpserverutility.scripttimeout.aspx
It says that ScriptTimeout only works when you have <compilation
debug="true"> in the web.config so it won't be an option for my production
application

Hello Andy,

This is an error/typo in the documentation. ScriptTimeout is ignored (or
rather it's set to 30.000.000 seconds, around 350 days) when debug is
set to true, so that you can set breakpoints and do debugging etc
without having the page timeout.

Ben
 
A

Andy Fish

just as a follow up

in my global.asax Application_BeginRequest handler I was able to test the
URL and reset Server.ScriptTimeout if the url is the file upload page,
otherwise leave it as the default

I verified that this all works perfectly
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top