0

I'm using fineuploader to upload a file. everything works fine for files under 200MB. everything over just fails. A new file is created but it's empty (meaning 0kb)

already modified my web.config to allow for up to 500mb uploads. but doesn't seem to help.

web.config:

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

and

<httpRuntime targetFramework="4.5" maxRequestLength="512000" executionTimeout="900" requestLengthDiskThreshold="512000" />

Controller:

[HttpPost]
public ActionResult Upload(string qqfile)
{
    try
    {
        Stream stream = Request.Files.Count > 0 ? Request.Files[0].InputStream : Request.InputStream;

        string filePath = Path.Combine(@"C:\Temp\100", qqfile);
        using (Stream file = System.IO.File.OpenWrite(filePath))
        {
            stream.CopyTo(file);
        }
....

Why can't I upload files over 200MB?

tereško
  • 58,060
  • 25
  • 98
  • 150
ShaneKm
  • 20,823
  • 43
  • 167
  • 296

2 Answers2

0

The first thing that springs to mind is a limitation in IIS. Before "Integrated Mode" in IIS7 one had to deal with the IIS-MetaBase for setting IIS-properties.

If you're running your website in "Integrated Mode" or using the VS Development Webserver (Cassini-based) it might work, if you're running production in "Classic Mode" it will not use the integrated-configuration and fall back to the metabase. If it does and you haven't edited the metabase then any upload over the default metabase-upload-limit will fail.

From your code/config/question I can't determine what mode the website you're having problems with is running - which might be vital to answer your question - so please supply these details.

Miggro
  • 26
  • 4
0

Figured it out: It was a web.config settings:

web.config:

<httpRuntime targetFramework="4.5" maxRequestLength="2147483647" executionTimeout="90" requestLengthDiskThreshold="2147483647" />

and

 <system.webServer>
      <security>
          <requestFiltering>
              <requestLimits maxAllowedContentLength="4294967295" />
          </requestFiltering>
      </security>
  </system.webServer>

Thanks Yasser for pointing me in the right direction

ShaneKm
  • 20,823
  • 43
  • 167
  • 296