Uploading file size over 4 MB in .NET

℡╲_俬逩灬. 提交于 2019-12-24 03:04:36

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!