1

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?

Jordan
  • 3,998
  • 9
  • 45
  • 81
  • Hah?? I believe it wont be the problem to upload 400 MB files. Please check it whether you have setup your own default page correctly. –  Apr 14 '14 at 04:01
  • I'm not really sure that I understand your comment. Uploading the file is not the issue, I have direct access to the server and can place the file directly into the webserver folder. If I do this with a small file then it shows up in the server's directory listing when you visit the URL and if you click it then it will download, but if I do this with a large file then it still shows up in the listing, but if I click it then it shows the 404. – Jordan Apr 14 '14 at 14:45
  • So the problem when you open the file? hmm... It is quite weird. Is your file corrupted? –  Apr 14 '14 at 16:05
  • No, I've tried with multiple large files, none work (but I can open them directly from the server OS). – Jordan Apr 14 '14 at 20:51
  • See: http://www.webdavsystem.com/server/documentation/large_files_iis_asp_net – Meysam Tolouee May 15 '14 at 09:40
  • That is for uploading files, the issues is that it will not allow downloading of large files that are already on the server. – Jordan May 15 '14 at 15:34

2 Answers2

2

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)

Community
  • 1
  • 1
Jon Onstott
  • 13,499
  • 16
  • 80
  • 133
  • AHA! That was it. The only files I had large enough to test with were .mkv video files, which are not a default MIME type. – Jordan May 16 '14 at 17:54
0

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