Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET page specific configuration

Is there any way to make some sections of the web.config file only apply to a single file (or directory, or a group of files, etc.)

Basically I would like to apply the following thing only to a single page in the application, the rest should use the default settings: (it limits the upload size to 32M)

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

The point is that I only want that particular page to accept large files.

like image 991
Tamas Czinege Avatar asked Dec 06 '22 07:12

Tamas Czinege


1 Answers

You can use:

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

More info here.

like image 126
Eduardo Campañó Avatar answered Jan 06 '23 22:01

Eduardo Campañó