大型文件上传,但HTML格式(超过2 GB) [英] Large file upload though html form (more than 2 GB)

查看:179
本文介绍了大型文件上传,但HTML格式(超过2 GB)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

无论如何上传超过2 GB的文件,使用简单的HTML表单上传?以前我一直在用silverlight上传大文件(把大文件分割成段,然后逐个上传段,然后在服务器上重新组合段)。

现在,我们有一个要求,我们只需要使用简单的HTML(虽然GWT)表单上传。请指导我,如果有什么办法可以实现大文件上传的话。

如果使用简单的html不可能做到这一点,任何人都可以指导我如何划分&用flex分段上传一个文件?解决方案

通常情况下,HTTP POST请求的大小限制不在HTML端所有。服务器端的限制更多。 Web服务器需要配置为接受大的POST请求。默认值通常是2GB,服务器通常会返回一个HTTP 500错误。默认的限制通常可以增加到4GB,但是除此之外的任何内容都会在32位系统上遇到边界。在使用64位操作系统的64位系统上,理论边界要高得多,16EB。如果配置Web服务器接受大的POST请求不是一个选项,或者当你想要超越Web服务器的限制,那么除了在客户端分割文件和重新组装服务器端的部分,你别无选择。

因为HTML只是它是一种标记语言,它不提供分割文件的功能。您真的必须使用像C#(Silverlight)或Java(Applet)这样的普通编程语言来处理由您的网页提供的小型应用程序。也许这也可能是Flash或Flex,但不要固定我,因为我不这样做。

表示FTP比HTTP更好通过网络传输(大)文件。我会重新考虑使用HTTP的选择。


Is there anyway to upload a file more than 2 GB, using simple html form upload? Previously I have been uploading large files through silverlight using chunking (dividing a large file into segments and then uploading segments one by one & then reassemble segments at server).

Now, we have a requirement that we just have to use simple html (though GWT) form uploads. Please guide me if there is any way to achieve large file upload this way.

If it is impossible to do it using simple html, can anyone guide me about how I can divide & upload a file in segments using flex?

解决方案

The limitation of the size of HTTP POST requests is usually not in the HTML side at all. The limitation is more in the server side. The webserver needs to be configured to accept that large POST requests. The default is usually indeed often 2GB and the server will usually return a HTTP 500 error on that. The default limit can often be increased to 4GB, but anything beyond that will hit the border on 32bit systems. On 64bit systems with a 64bit OS, the theoretical border is much higher, 16EB.

If configuring the webserver to accept that large POST requests is not an option, or when you want to go beyond the webserver's limit, then you have no other option than splitting the file in the client side and reassembling the parts in the server side.

Since HTML is just a markup language, it offers no facilities for splitting the file. You really have to use a normal programming language like C# (Silverlight) or Java (Applet) in flavor of a small application which you serve by your webpage. Very maybe it's also possible with Flash or Flex, but don't pin me on that since I do neither.

Said that, FTP is a much better choice than HTTP for transferring (large) files over network. I'd reconsider the choice of using HTTP for that.

这篇关于大型文件上传,但HTML格式(超过2 GB)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
前端开发最新文章
热门教程
热门工具
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆