如何在C#Asp.Net中上传超过4 G大小的文件 [英] How Can I Upload File More Than 4 G Size In C# Asp.Net

查看:143
本文介绍了如何在C#Asp.Net中上传超过4 G大小的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以帮助我

i创建上传项目但我无法上传大尺寸我阅读更多文章我尝试更多将这个值放在最大长度但我不能





< httpruntime maxrequestlength =2000000000delaynotificationtimeout =108000executiontimeout =108000000000>



can any one help me
i create upload project but i cant upload large size i read more articles and i try more to put this value in Max Length but i cant


<httpruntime maxrequestlength="2000000000" delaynotificationtimeout="108000" executiontimeout="108000000000">

<sessionState timeout="360000" sqlCommandTimeout="360000" stateNetworkTimeout="360000">
    </sessionState>





如果我放3 G我不能这样做

< httpruntime maxrequestlength =3000000000delaynotificationtimeout =108000executiontimeout =108000000000>



i此行有错误



i需要上传4个以上的文件或6 G

注意:我使用MVC和Visual Studio 2013

感谢任何人帮助我



if i put 3 G i cant do it
<httpruntime maxrequestlength="3000000000" delaynotificationtimeout="108000" executiontimeout="108000000000">

i have error in this line

i need to upload files more than 4 or 6 G
note : i used MVC and Visual Studio 2013
appreciate any one help me

推荐答案

首先我不知道为什么你在MVC中使用 sessionState ,注意一个好的做法要求你应该考虑避免它们(甚至在引入MVC之前)。 />


尽管如此,回到上传问题,您可以修改项目的web.config文件以启用2GB上传。更具体地说,你需要增加 maxRequestLength ,默认情况下是4096 KB(4 MB),可能是 executionTimeout

你还需要为 requestLimits 调整~28.6 MB的另一个限制。

First I don't know why you are using sessionState in MVC, note that a good practices dictates that you should consider avoiding them (even before the MVC was introduced).

Nevertheless back to your upload issue, you can modify the project's web.config file to enable the 2GB upload. To be more specific you need to increase the maxRequestLength which is 4096 KB (4 MB) by default and probably the executionTimeout.
Also you need to adjust another restriction of ~28.6 MB for requestLimits.
<system.web>
    ...
    <httpRuntime maxRequestLength="2147483647" executionTimeout="3600" />
	<security>
      <requestFiltering>
        <requestLimits maxAllowedContentLength="2147483647" />
      </requestFiltering>
    </security>
    ...
</system.web>



但是对于较大的上层,你需要改变方法,你可以尝试这里提到的一些建议:上传大在asp.net mvc中的文件 [ ^ ]

或者你可以试试这个:如何上传Mvc中的大文件? [ ^ ]


这篇关于如何在C#Asp.Net中上传超过4 G大小的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆