问题
I am having trouble uploading a file size over 4 MB. I've tried adding
<httpRuntime maxRequestLength="102400" executionTimeout="99999" />
to my Web.Config like many posts have suggested, but it just isn't working. Files under 4 MB work just fine, so I'm nearly certain I'm running into the 4 MB limit. Are there any settings in IIS that I might need to change?
回答1:
You need to update the value of maxrequestlength in the web.config:
Maximum value of maxRequestLength?
Max Request Length
回答2:
You can use that code into your web.config file.
<system.web>
<httpRuntime executionTimeout="3600" maxRequestLength="102400000000"
appRequestQueueLimit="100000" requestValidationMode="4.0"
requestLengthDiskThreshold="10024000000000"/>
</system.web>
I think it will work
来源:https://stackoverflow.com/questions/7154333/uploading-file-size-over-4-mb-in-net