Question

I'm running IIS 8 on Windows Server 2012R2, and I'm having an issue. I'd like to be able to host large files, but it's causing problems. If I put anything over ~400MB on it, then when I try to access that file from a browser I get a "404 file not found" error.

I should note that smaller files work fine. Any thoughts?

Was it helpful?

Solution

The problem could be that your MIME types need to be modified. From https://serverfault.com/a/78526/12894:

What is probably happening is that your server doesn't know that .war is a type of file that needs to be downloaded rather than executed. It then is run through your allowed Web Service Extensions for any matches. If it doesn't find one, it throws a 404 error even though the file does in fact exist.

If you set a MIME type for war files of type application/octet-stream, that should resolve your issue.

See also the Microsoft article Requests for static files return 404 error (IIS 6.0)

OTHER TIPS

Have you tried looking at the Web.config file for the maxrequestlength tag? The problem in this case is not the upload, but rather the request for the file, when the page is loaded. Look for the following line:

<httpruntime maxrequestlength="51200" executiontimeout="7200"/>

Where I set the second number to 2 hours (just a random timeout time) and the first number is the maximum file size that a page that needs the file can request. In this case, you can have 500Mb of upload size. This may fix it, however, there's also another section that you can edit, added in for security purposes:

<security> 
<requestFiltering> 
<requestLimits maxAllowedContentLength="524288000"/> 
</requestFiltering> 
</security> 

Here, again you have 1024x1024*500=500Mb. This is edited in the session properties - you can do that through the Management Interface or through writing your own scripts. Have a look at MSDN here:

http://technet.microsoft.com/en-us/library/cc725820(v=ws.10).aspx

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top