problem w/ file upload properties
hi,
i have a problem with file upload. when im trying to send the page it didnt redirect me instead the page cannot be displayed..
im having a problem uploading more than 4mb file size although i have a validation for the file size,how can i set the max. limit of the file upload properties?
privatevoid btnSubmit_Click(object sender, System.Web.UI.ImageClickEventArgs e)
{ Response.write("something");
Response.end(); }
when im uploading less than 4mb file the program will do the response.write.. but when im trying to upload more than 4mb, the program will display<the page cannot be displayed in I.E.>
or in firefox
The connection was reset
The connection to the server was reset while the page was loading.
* The site could be temporarily unavailable or too busy. Try again in a few
moments.
* If you are unable to load any pages, check your computer's network
connection.
* If your computer or network is protected by a firewall or proxy, make sure
that Firefox is permitted to access the Web.
[1583 byte] By [
sign] at [2008-2-7]
default file upload size in ASP.NET is 4MB because of security considerations
this is from MSDN
One way to guard against denial of service attacks is to limit the size of the files that can be uploaded using the FileUpload control. You should set a size limit that is appropriate for the types of files that you expect to be uploaded. The default size limit is 4096 KB (4 MB). You can allow larger files to be uploaded by setting the maxRequestLength attribute of the httpRuntime element. To increase the maximum allowable file size for the entire application, set the maxRequestLength attribute in the Web.config file. To increase the maximum allowable file size for a specified page, set the maxRequestLength attribute inside the location element in Web.config. For an example, see location Element (ASP.NET Settings Schema). |
|
http://msdn2.microsoft.com/en-us/library/system.web.ui.webcontrols.fileupload.aspx
check on this thread also - http://forums.asp.net/thread/169291.aspx
hope this helps