如何在使用jquery.MultiFile.js时扩展上传和发送(通过电子邮件)文件的最大文件大小

时间:2012-10-23 21:01:26

标签: c# jquery asp.net multifile-uploader multifile

我正在使用jquery的插件来使用多文件上传来创建发送电子邮件的程序..

检查来源

http://www.fyneworks.com/jquery/multiple-file-upload/

我在这里下载了,我还没修改它......

我注意到你总共不能上传超过10MB,但是,你不能发送超过4MB的单个文件......

我已经被告知你可以发送不超过10MB的文件,但是我的老板只是试图发送一个4.11MB的pdf文件,它不发送它....

我尝试通过Visual Studio发送它(这样我可以调试它,看看问题出在哪里......显然,一旦我附加了文件并点击SEND EMAIL ...程序不会访问页面加载和按钮,它只是声明连接已重置...

如果您尝试发送(不使用Visual Studio,但来自互联网)......它会发送此错误

Maximum request length exceeded.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: Maximum request length exceeded.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


[HttpException (0x80004005): Maximum request length exceeded.]
   System.Web.HttpRequest.GetEntireRawContent() +9037851
   System.Web.HttpRequest.GetMultipartContent() +68
   System.Web.HttpRequest.FillInFormCollection() +247
   System.Web.HttpRequest.get_Form() +104
   System.Web.HttpRequest.get_HasForm() +9038959
   System.Web.UI.Page.GetCollectionBasedOnMethod(Boolean dontReturnNull) +97
   System.Web.UI.Page.DeterminePostBackMode() +69
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +135

我已经检查了jquery文件,但我似乎找不到任何可以解决问题的方法。

你知道问题出在哪里吗?以及如何解决这个问题?

1 个答案:

答案 0 :(得分:8)

修改httpRuntime元素的web.config设置,如下所示

<httpRuntime maxRequestLength="4096" />

该值以KB为单位。默认情况下,它是4 MB。