Upload and Download

  Changing Upload Size Limit

Table of Contents
Upload and DownloadPrint||
Changing Upload Size Limit

Code On Time automatically handles file uploading and downloading for blob fields. However, ASP.NET limits file upload size to 4 MB by default. When a user attempts to upload a larger file, an error will be thrown.

Error message showing that max request length is exceeded.

Let’s change the file size limit in order to allow for larger files to be uploaded.

Start the web application generator. Click on the project name, and select Settings. Press Web Server Configuration.

In the Web.Config modification instructions, insert the following:

SetAttribute: /configuration/system.web/httpRuntime
maxRequestLength: 102400

The maxRequestLength value is the size limit in KB.

Press Finish, and continue to regenerate the web application. When a file larger than 4 MB is uploaded, the upload will no longer throw an error.

File upload has been successful.