Re: Maximum file upload question

Tech-Archive recommends: Fix windows errors by optimizing your registry



Hmmm... a bit nitpicky, but true.

I say nitpicky because I've been trying to figure out what an http request larger than
1MB looks like, other than an uploaded file...and can't come up with a valid example.

However, for comprehensiveness sake, ( just in case a request is made which isn't
an uploaded file but is larger than 1MB ) the following web.config entry would cover all bases :

<configuration>
<location path="UploadPage.aspx">
<httpRuntime maxRequestLength="1024"/>
</location>
</configuration>

Notice that the entry can be located in the root web.config.
A separate web.config is not needed.

If the upload aspx is in a different directory, including the path will do fine :

<location path="/directory/UploadPage.aspx">




Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
======================================
"Scott Roberts" <sroberts@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:u2F1T%23lKIHA.5328@xxxxxxxxxxxxxxxxxxxxxxx
It should be noted that this entry will limit the size of all HTTP requests for all pages controlled by that
web.config. You can, however, put the "upload file" page in its own sub-folder and put a web.config in that folder
with the appropriate settings. For example, you might also want to adjust the timeout value to allow for slow uploads,
etc.

I guess my point is, the upload settings for files is probably different than for "regular" requests, so consider
putting pages that upload files into their own sub-folder with their own web.config.


!> I would like to limit the user to upload at the maximum 1 meg of file

Iy's very simple...

In web.config :

<httpRuntime maxRequestLength="1024"/>




.



Relevant Pages

  • Solution design
    ... allow the end user to upload photos to the server. ... The first request would trigger for creating: ... and uses the advantages of the .NET technologies even on client side). ... we tried to create a Java applet that was trying to ...
    (microsoft.public.dotnet.general)
  • Re: File Upload Web Service
    ... using vba with wininet api for the upload because I need the solution to ... > client(OFFICE VBA ?). ... > However, since you'd like to call the webservice in VBA application, I ... > capable of handling client uploaded file. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: I cant get httpWorkerRequest.ReadEntityBody() to work !!!
    ... ASP.NET Httpmodule to intercept file upload requests. ... The HttpWorkerRequest class is a raw abstract class ... help us access the uploaded file streams in the Multi-Part form request. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: [PHP] php File upload
    ... support on the client, and a server that understands the DAV request. ... I've not had to upload such large files over HTTP, ... sends them in the response headers when serving a GET request. ...
    (php.general)
  • Re: When does the httpRuntime maxRequestLength setting kick in?
    ... maxRequestLength is used to monitor the input stream (upload). ... throws an exception if a HTTP request is too large. ...
    (microsoft.public.dotnet.framework.aspnet)