Configuration on an ASP.NET Page

Is there a way to make certain sections of the web.config file applicable to only one file (or directory, or group of files, etc.).

Basically, I would like to apply the following to only one page of the application, the rest should use the default settings: (it limits the upload size to 32 MB)

<system.web> <httpRuntime maxRequestLength="32768" executionTimeout="360"/> </system.web> 

The thing is, I want this particular page to accept large files.

+4
source share
4 answers

You can use:

  <location path="UploadPage.aspx"> <system.web> <httpRuntime maxRequestLength="33554432" executionTimeout="360" /> </system.web> </location> 

More details here .

+13
source

You can put the web.config file in any directory of your web application, what you define will work only for this directory and below.

+2
source

You can also try it with the <location> , however I'm not sure if you can use it with <httpRuntime> .

0
source

To do this, use the <location path = "..."> element. The path can point to a directory as well as a file. You will need to set allowDefinition = "everywhere."

0
source

All Articles