C# 中的 2 GB 文件上传

发布于 2024-08-07 05:18:04 字数 176 浏览 2 评论 0原文

有一个要求,客户端需要一个选项来通过浏览器上传非常大(<=2GB)的文件。

而且我发现浏览器只能支持2GB的文件上传。是这样吗?

如果是的话,那么至少1.9999GB有什么解决办法吗?

尝试使用 maxRequestLength、executionTimeout 等参数,但没有结果。

There is a requirement where the client needs a option to Upload Files that are really large (<=2GB) through browser.

And i found that the browser can support only 2GB file upload. Is it so?

If yes, then for at least 1.9999GB is there any solution?

Tried working with the parameters like maxRequestLength, executionTimeout which resulted in nothing.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

冷了相思 2024-08-14 05:18:04

使用 Flash 或 Silverlight 的客户端控件的替代方法是使用 Darren Johnson 的 ASP.NET 上传模块。我建议你看看这个。

它是一个 IIS HTTP 模块,允许以小块的形式上传文件,从而减少内存使用。有一些客户端 JavaScript 会向用户显示上传进度。

我成功地将其与 MOSS 2007 一起使用,并使用高达 2GB 的文件对其进行了测试 - 效果非常好!

An alternative to using a client side control using Flash or Silverlight is to use Darren Johnson's ASP.NET upload module. I'd recommend you take a look at this.

It's an IIS HTTP module that will allow files to be uploaded in small chunks, reducing memory usage. There is some client side JavaScript that will show the user the upload progress.

I'm successfully using this with MOSS 2007 and have tested it with files up to 2GB - it works great!

℡Ms空城旧梦 2024-08-14 05:18:04

你必须在 machine.config 中设置它
请参阅:http://support。 microsoft.com/?scid=kb;en-us;295626&x=12&y=6

You have to set it in the machine.config
see this: http://support.microsoft.com/?scid=kb;en-us;295626&x=12&y=6

甜点 2024-08-14 05:18:04

如果您要上传大文件,最好使用用 Sliverlight 或 flash 编写的客户端控件来上传文件。这样,控件可以将文件分割成更小的块,然后单独上传。

“正常”文件上传的问题在于它是一次性事件并且没有重试机制。此外,网络服务器和代理并未针对长请求进行优化。当客户端距离主机 Web 服务器越来越远时,它往往会通过不受您控制的系统(代理等)进行路由。根据我的经验,这些会对大文件造成严重破坏。

If you are uploading large files it is probably better to use a client side control written in either Sliverlight or flash to upload the file. That way the control can split the file into smaller chucks that are uploaded individually.

The problem with a "normal" file upload is that it is a one shot affair and has no retry mechanism. Also web servers and proxies are not optimised for long requests. As the client gets further away from the host web server it tends to get routed through systems (proxies and such like) that are not in you control. In my experience these play havoc with large files.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文