Kalpesh Rajai
Kalpesh Rajai

Reputation: 2056

How to upload file with the 10GB+ size in ASP.NET C#

I am trying to upload file with size more than 10GB+ and there is multiple files that i want to upload at the server.

I made some changes in Web.config to upload large files.

 <system.web>
    <compilation debug="true" targetFramework="4.5" />
    <httpRuntime executionTimeout="6000000" maxRequestLength="2147483647"/>
  </system.web>

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

But it only support the file size up to 2GB. I do too much research but I can not get anything that help me to upload 10GB+ file size.

I read some article that said that the maximum file size limit is 2GB

Maximum value of maxRequestLength?

IIS 7 httpruntime maxRequestLength limit of 2097151

https://blogs.msdn.microsoft.com/prashant_upadhyay/2011/07/12/large-file-upload-issue-in-asp-net/

I found some hacks that I slice the file at the client side (browser) and upload that all the slice at the server and after that i merge all that slice to single file.

But this may be wrong idea to do that, If some slice of file is failed to upload or missed so file may be corrupted.

I don't want to implement the Slice and Upload and Merge file technique to upload large file.

There is any another way to do the Upload Larger files (10GB+ size) with the ASP.NET and C#.

Thanks.

Upvotes: 4

Views: 2889

Answers (1)

Pragnesh
Pragnesh

Reputation: 77

only use this

<system.web>
<compilation debug="true" targetFramework="4.5" />
<httpRuntime executionTimeout="6000000" maxRequestLength="10485760"/>
</system.web>

remove below code from web.config

<security>
  <requestFiltering>
    <requestLimits maxAllowedContentLength="2147483647" />
  </requestFiltering>
</security>

and 10gb = 10485760 kb

Upvotes: 0

Related Questions