Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
470 views
in Technique[技术] by (71.8m points)

asp.net - Increasing Max Upload File Size on IIS7/Win7 Pro

I'm setting up a server for a client (something I don't typically do), and I'm running into issues with uploading larger files (11MB). The server is running Windows 7 Professional with IIS added.

In web.config I've tried setting

<system.web>
    <httpRuntime maxRequestLength="65536" /> <!-- 64MB -->
</system.web>

... and that doesn't work.

I've set

<system.webSecurity>
    <security>
        <requestFiltering>
            <requestLimits maxAllowedContentLength="68157440" />
        </requestFiltering>
    </security>
</system.webSecurity>

... and that doesn't work either.

What am I missing here? As I've said, I don't typically set up servers, so I may be missing something obvious... no suggestion will be scoffed at!

Thanks in advance.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

Change system.webSecurity to system.webServer.

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

If that doesn't work (due to permissions ramifications), set it using appcmd from an elevated command prompt:

appcmd set config "wms/wmsdev" -section:requestFiltering -requestLimits.maxAllowedContentLength:52428800

More info here: http://bloggingabout.net/blogs/ramon/archive/2009/03/13/how-to-enable-large-file-uploads-in-iis7.aspx


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...