如何在ASP.NET C#中上传10GB +大小的文件 [英] How to upload file with the 10GB+ size in ASP.NET C#

查看:60
本文介绍了如何在ASP.NET C#中上传10GB +大小的文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试上传大小超过10GB的文件+我想在服务器上传多个文件。



我在网上做了一些更改.config上传大文件。



我尝试过:



< system.web>

< compilation debug =truetargetframework =4.5>

< httpruntime executiontimeout =6000000maxrequestlength =2147483647 >





< system.webserver>

< security>

< requestfiltering>

< requestlimits maxallowedcontentlength =2147483647>









但它只支持最大2GB的文件大小。我做了太多研究,但是我无法获得任何帮助我上传10GB +文件大小的内容。



我读了一篇文章说文件大小限制为2GB



maxRequestLength的最大值?



IIS 7 httpruntime maxRequestLength限制为2097151



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



我发现了一些黑客,我在客户端(浏览器)切片文件并上传服务器上的所有切片,之后我将所有切片合并到单个文件中。



但这可能是错误的想法,如果某些文件片段无法上传或错过,那么文件可能已损坏。



我不想实现Slice and Upload和Merge文件技术来上传大文件。



还有其他办法可以使用ASP.NET和C上传较大的文件(10GB +大小) #。



谢谢。

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.

What I have tried:

<system.web>
<compilation debug="true" targetframework="4.5">
<httpruntime executiontimeout="6000000" maxrequestlength="2147483647">


<system.webserver>
<security>
<requestfiltering>
<requestlimits maxallowedcontentlength="2147483647">




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.

推荐答案

上传非常大的文件可能对所有用户都不可靠,所以切片会是一个好主意。显然,您需要这样的代码来确保您获得所有切片(并且它们没有被破坏)并重新发送丢失或损坏的切片。在任何情况下,您都不希望对这些大文件使用默认处理,因为上传文件可能需要数小时,您需要向用户发送一些反馈。



Jon Galloway - ASP.NET中的大文件上传 [ ^ ]



HTML大文件上传器 [ ^ ]



您也可以考虑创建一个独立的应用程序让您的用户发送大文件。然后,您可以向他们提供有关进度的更好反馈,并且可能允许进行一些调整以获得最佳性能,并且还可能实现暂停上载并在崩溃或重新启动计算机后重新启动部分上载。
Uploading very large file might not be reliable for all user anyway so doing slice would be a good idea. Obviously, you would need so code to ensure you got all slices (and that they are not corrupted) and resend missing or corrupted slices. In any case, you would not want to use default handling for such large files as it might take hours to upload a file and you would need to send some feedback to the user.

Jon Galloway - Large file uploads in ASP.NET[^]

HTML Large File Uploader[^]

You might also consider creating a standalone application to let your user send big files. You would then be able to give them better feedback on progress and maybe allows some tuning for best performance and possibly also implement pausing the upload and restart partial upload after a crash or reboot of the computer.


这篇关于如何在ASP.NET C#中上传10GB +大小的文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆