【问题标题】:Error during Execution of File Upload [duplicate]执行文件上传时出错[重复]
【发布时间】:2016-04-22 20:02:48
【问题描述】:

在图像上传时执行项目期间,浏览器显示此错误。 我使用 SQl Server 作为数据库。

`Server Error in '/' Application.
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() +9803702
   System.Web.HttpRequest.GetMultipartContent() +63
   System.Web.HttpRequest.FillInFormCollection() +160
   System.Web.HttpRequest.EnsureForm() +69
   System.Web.HttpRequest.get_Form() +13
   System.Web.HttpRequest.get_HasForm() +9800635
   System.Web.UI.Page.GetCollectionBasedOnMethod(Boolean dontReturnNull) +95
   System.Web.UI.Page.DeterminePostBackMode() +69
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +220
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1073.0`

SQl Server 文件上传过程中是否有任何限制?

【问题讨论】:

    标签: c# sql asp.net sql-server web


    【解决方案1】:

    此错误是由您的 Web 服务器而不是 SQL 服务器引发的。

    如果您使用的是 IIS,您可以修改 web.config 以允许上传大文件。

    <configuration>
        <system.web>
            <httpRuntime maxRequestLength="xxxxxx" />
        </system.web>
    </configuration>
    

    对于 IIS 版本 7 及更高版本,请使用以下内容..

    <system.webServer>
       <security>
          <requestFiltering>
             <requestLimits maxAllowedContentLength="xxxxxxx" />
          </requestFiltering>
       </security>
     </system.webServer>
    

    以上示例取自here

    另外,请阅读this

    【讨论】:

    • 你为什么要给出原始答案的链接? stackoverflow.com/questions/3853767/…
    • 对不起..我应该有..我使用了多个来源来获得正确的语法以显示在配置文件中。我修改了答案
    • 不建议抄袭。如果您知道来源,请注明出处。您也可以发表相同的评论
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2013-01-12
    • 2013-11-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-02-09
    • 1970-01-01
    相关资源
    最近更新 更多