Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

file upload issue

I will need client (end user) through browser to upload big files (e.g. similar to Youtube's scenario which uploads big video files), the file size should be no larger than 500M bytes.

I am using ASP.Net + C# + VSTS + IIS 7.0 as my development platform. Any ideas or good practices about how to handle big file upload issue? Any reference samples or documents are appreciated.

like image 586
George2 Avatar asked Jun 20 '09 08:06

George2


People also ask

Why would a file fail to upload?

The reason your file may have failed is that there was an interruption in your internet connection or you accidentally navigated away from the page. To solve this problem, simply try uploading the file again!

Why is my file taking forever to upload?

Upload speed is affected by your Internet connection and the size of the file you are uploading. If you have a slow Internet connection or a very large file this will increase the amount of time a file will take to upload. Tips to speed up the upload: You can try reducing the size of the file before uploading.

Why is my file not uploading to my drive?

You may have to restart the upload, and the best way to do that is to restart the Google Drive app. To do this on Android, go to “Settings -> Apps & notifications -> See all apps.” Find Drive in the list, tap “Force Stop,” then try your upload again.


1 Answers

    <system.web>
        <httpRuntime executionTimeout="300" maxRequestLength="512000" />
    </system.web>

This will not work in IIS7! httpRuntime is for IIS6 and bellow. The correct way to allow large file uploads in IIS7 is:

1) Add the following lines to the web.config file:

[Web.config] maxAllowedContentLength attribute for IIS7

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

2)Then open the file C:\Windows\System32\inetsrv\config\applicationHost.config and find the line:

<section name="requestFiltering" overrideModeDefault="Allow" />

overrideModeDefault should be Allow.

like image 59
Genady Sergeev Avatar answered Oct 20 '22 19:10

Genady Sergeev