2014-06-21 2 views
2

업로드 파일을위한 비동기 메서드가 있습니다. 내 web.config에 이미 maxcontentlength을 설정했습니다.MVC에서 대용량 파일 업로드 문제

하지만 15MB보다 큰 파일을 업로드 할 수 없습니다. 그것은 나에게 오류 err_connection_reset을 주었다. 내 호스팅은 최대 1GB의 파일 업로드와 90 초의 실행 시간 초과를 지원합니다.

여기 내 코드 샘플입니다.

[NoAsyncTimeout] 
[HttpPost] 
[ValidateAntiForgeryToken] 
public async Task<ActionResult> Create(Videos video) 
{ 
    if (ModelState.IsValid) 
    { 
     if (video.CategoryId > 0) 
     { 
      if (Request.Files.Count > 0) 
      { 
       try 
       { 
        //Server.ScriptTimeout = 9001; 
        file.SaveAs(path); 

        // ... other operations 
       } 
       catch (Exception ex) 
       { 
        string error = ex.Message; 
       } 
      } 
     } 
    } 
} 

여기에 내 web.config 속성입니다. 또한 최대 실행 시간 제한을 만들려고했습니다.

<httpRuntime targetFramework="4.5" maxRequestLength="1073741824" requestValidationMode="2.0" /> 
<security> 
     <requestFiltering> 
     <requestLimits maxAllowedContentLength="1073741824" /> 
     </requestFiltering> 
    </security> 

답변

0

제 문제가 수정되었습니다. 호스팅 패널에서 약 enabling 32 bit applications입니다.

+0

이상한 - 왜 큰 업로드를해야하는지 알 수 있습니까? – cryss

+0

아마도 ISAPI 필터 때문일 수 있습니다. 그러나 다른 것에 대해서는 전혀 모른다. 방금 시도했는데 문제가 해결되었습니다. 그러나 그 당시에는 다른 모든 프로젝트에도 문제가있었습니다. 이제 모든 것이 좋습니다. – Kadir