文件上载控件不接受大文件 [英] File Upload Control does not accept Large Files
问题描述
你好,我的网站遇到了一些问题:
1)我试图为所有错误设置错误页面,尽管它出现了什么样的错误......
2)我的网站上有一个fileupload控件,每当我尝试上传一个大文件时,当我请求文件的长度时它会卡住
hello , i have been having some problems with my website:
1) I am trying to set an error page for all the errors that could accour despite what kind of error it is ...
2) i have a fileupload control in my website and whenever i try to upload a large file it get stuck when i request the length of the file
FileUpload1.PostedFile.ContentLength.ToString();
或
Or
FileUpload1.FileContent.Length.ToString();
并提前谢谢
PS - 它适用于小文件
And thanks ahead
P.S - it works with small file
推荐答案
您需要设置web.config
文件以允许大文件。
请参阅 - 设置Web.config以允许上传大型ASP .NET应用程序的文件 [ ^ ]。
You need to set up theweb.config
file to allow large files.
See - Setting up Web.config to allow uploading of large files by ASP .NET applications[^].
修改web.config中的maxAllowedContentLength设置,如
Modify the maxAllowedContentLength setting in the web.config like,
<system.webserver>
<security>
<requestfiltering>
<requestlimits maxallowedcontentlength="2147483648" />
</requestfiltering>
</security>
</system.webserver>
您也可以阅读: http://blogs.msdn.com/b/prashant_upadhyay/archive/2011/07/13/large-file-upload-issue-in-asp -net.aspx [ ^ ]
-KR
You can read this as well : http://blogs.msdn.com/b/prashant_upadhyay/archive/2011/07/13/large-file-upload-issue-in-asp-net.aspx[^]
-KR
这篇关于文件上载控件不接受大文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!