We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

How to set upload file size limit for an UploadBox?

Description

When you upload a file using an UploadBox, you can limit the upload file size, since uploading large files can be restricted by setting the file size limit.

Solution

Uploading a file can be restricted based on its size, by setting the maximum file size limit in the webconfig file. Create a website with UploadBox control and set the maxRequestLength key value for httpRuntime tag under system.web as follows.

WEBCONFIG

The value of maxRequestLength has to be given in Kilo Bytes (KB).

When the application is run directly from the developer environment, it is enough to have the maxRequestLength added in httpRuntime section of system.web. But while deploying it to the server, you must set the maxAllowedContentLength value under system.webserver tag in webconfig, so that file limit is applied on hosting the website in server.

WEBCONFIG

The value of maxAllowedContentLength should be given in Bytes.

Article ID: Published Date: Last Revised Date: Platform: Control: Product Version:
2997 12/04/2014 12/04/2014 ASP.NET Web Forms Uploadbox 12.2.0.36
Tags:
Did you find this information helpful?
Add Comment
You must log in to leave a comment

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.