ASP.NET File Upload Maximum request length exceeded

You can hit the error "Maximum request length exceeded" if you are attempting to upload large files with ASP.NET

The web.config setting below changes the max size to 100MB

<httpRuntime requestValidationMode="2.0" executionTimeout="240" maxRequestLength="102400"/>

There was an error opening the document...The file is damaged and could not be opened

If you have used ASP.NET to upload documents into a database and got the error "There was an error opening this document. The file is damaged and could not be opened."

If you are using a DataSet and TableAdapter check the parameter on the stored procedure (if you used a stored proc) the size probably defaulted to 65336. Change it to -1 and you will be all set.

 

After (type is -1 and tab to the next field) 

Represent Folder Tree Structure in a Database

Check out this ASP.NET example over at Dev Fusion. Very simple, very elegant.

Sample download included here for reference.

 treeviewv2article.zip (152.45 kb)