Server error 404 or 413 when uploading files larger files

0
Hi, We encounter an issue comparable to the issue described in: https://community.mendix.com/questions/2303/Server-error-404-or-413-when-uploading-files The difference is that uploading files seems to work fine. However if the files are larger, we encounter the server error 404/413. In the FileManager we have set a max file size of 5 mb, the files we try to upload have a size of approx. 4.1 mb. In a local deployment the functionality is working properly. All files can be uploaded and a proper warning is generated when the file that is uploaded is too large (in this case > 5 mb). We do notice that when uploading a file that is larger than 5mb in a server deployment, we instantly get the error message 404/413, while in the local deployment we get the proper file to large message. The rewrite seems to work properly, but generates the following message in the error log: 2012-04-23T11:47:31 ************************** 2012-04-23T11:47:31 ************************** 2012-04-23T11:47:31 [Rewrite] Input: http://antrancetest.ant.local/file?fileID=9638&maxFileSize=5 2012-04-23T11:47:31 [Rule 0] Input: /file 2012-04-23T11:47:31 [Rule 1] Input: /file 2012-04-23T11:47:31 [Rule 2] Input: /file 2012-04-23T11:47:31 [Rule 3] Input: /file 2012-04-23T11:47:31 [Rule 4] Input: /file 2012-04-23T11:47:31 [Rule 4] Rule Pattern Matched 2012-04-23T11:47:31 [Condition 0] Input: fileID=9638&maxFileSize=5 2012-04-23T11:47:31 [Condition 0] Matched 2012-04-23T11:47:31 [Condition 0] Input: fileID=9638&maxFileSize=5 2012-04-23T11:47:31 [Rule 4] Output: http://localhost:8080/file?fileID=9638&maxFileSize=5 2012-04-23T11:47:31 [Rewrite] Proxy: http://localhost:8080/file?fileID=9638&maxFileSize=5 2012-04-23T11:47:31 ************************** 2012-04-23T11:47:31 [Proxy] Request: http://localhost:8080/file?fileID=9638&maxFileSize=5 2012-04-23T11:49:30 ************************** What can be the issue? Kind regards, Brian
asked
1 answers
2

Logged a ticket at Support and the following action resolved the issue:

ASP.NET rewriter module is the cause of the problem. It seems that ASP has a separate setting for the maximum request length that can be passed through it. See http://msdn.microsoft.com/en-us/library/e1f13641%28v=vs.80%29.aspx for more details, and to see that the setting 'maxRequestLength' has a default of 4096KB.

Could you please test this by adding the following XML to the 'system.web' node (next to the 'customErrors' node and again, adjust as needed): <httpruntime executiontimeout="”100000″" maxrequestlength="”2000000″"/>

Also we added the following to the web.config file: <security> <requestfiltering> <requestlimits maxallowedcontentlength="”2000000000″"/> </requestfiltering> </security>

Which sets the max upload to 2GB. This setting was not sufficient and the rewriter adjustment was required as well.

answered