2016-12-27 185 views
1

我使用Infragistics的igUpload上传多个文件。一切正常,当文件大小小于3 MB,但是当我尝试上传文件尺寸较大,它失败并返回该错误上传大尺寸文件失败igUpload

无法获取当前文件的状态!大概掉线

我也改变了uploadUtilsBufferSize到10485760,但仍然没有适用于更大的文件。以下是igUplaod的配置

Button.igUpload({ 
    mode: 'multiple', 
    multipleFiles: true, 
    AutoStartUpload: false, 
    progressUrl: "IGUploadStatusHandler.ashx", 
    controlId: "upload1", 
    labelUploadButton: "Upload", 
    onError: function(evt, ui) { 
     if (ui.errorType == "serverside") { 
      ErrorMessage.append("<p>" + ui.serverMessage + "</p>"); 
     } else if (ui.errorType == "clientside") { 
      ErrorMessage.append("<p>" + ui.errorMessage + "</p>"); 
     } 
    } 
}); 

回答

4

IIS Web服务器上存在最大请求长度限制。对于IIS 6,它是4 MB(详细信息here)。对于IIS 7和更高版本是28.6 MB(详细信息here)。

,取决于您所使用尝试在web.config以下设置是什么版本的IIS的:

IIS 6(web.config中):

<system.web> 
    <httpHandlers> 
     <add verb="GET" type="Infragistics.Web.Mvc.UploadStatusHandler" 
         path="IGUploadStatusHandler.ashx" /> 
    </httpHandlers> 
    <httpModules> 
     <add name="IGUploadModule" type="Infragistics.Web.Mvc.UploadModule" /> 
    </httpModules> 
    <!--OPTIONAL: Set the maximum request length. 
    By default the request lenght is 4 MB. 
    More info: http://msdn.microsoft.com/en-us/library/e1f13641(v=vs.85).aspx--> 
    <httpRuntime executionTimeout="3600" maxRequestLength="2097151000"/> 
</system.web> 

IIS 7(及更高版本)( web.config中):

<system.webServer> 
    <modules runAllManagedModulesForAllRequests="true"> 
     <add name="IGUploadModule" type="Infragistics.Web.Mvc.UploadModule" 
            preCondition="managedHandler" /> 
    </modules> 
    <handlers> 
     <add name="IGUploadStatusHandler" path="IGUploadStatusHandler.ashx" verb="*" 
      type="Infragistics.Web.Mvc.UploadStatusHandler" preCondition="integratedMode" /> 
    </handlers>  
    <security>  
     <requestFiltering>  
      <!--OPTIONAL: Set the maximum request length. 
      By default the request lenght is ~30 MB. 
      More info: http://www.iis.net/configreference/system.webserver/security/requestfiltering/requestlimits--> 
      <requestLimits maxAllowedContentLength="2097151000"/> 
     </requestFiltering>  
    </security> 
</system.webServer> 

PS:此信息在Ignite用户界面帮助here记录。