简体   繁体   English

在JSF中上传大文件

[英]Uploading large files in JSF

I want to upload a file that is >16GB. 我想上传一个大于16GB的文件。 How can I do this in JSF? 如何在JSF中做到这一点?

When using HTTP, you'll face two limitations. 使用HTTP时,您将面临两个限制。 The one on the client side (webbrowser) and the one on the server side (webserver). 一个在客户端(Web浏览器),一个在服务器端(Web服务器)。 The average webbrowser (IE/FF/Chrome/etc) has a limit of 2~4GB, depending on the make/version/platform. 一般的网络浏览器(IE / FF / Chrome / etc)的限制为2〜4GB,具体取决于品牌/版本/平台。 You cannot control this from the server side on. 您无法从服务器端进行控制。 The enduser has to change the browser settings itself (sometimes this isn't possible at all). 最终用户必须自己更改浏览器设置(有时根本不可能)。 The average webserver (Tomcat/JBoss/Glassfish/etc) in turn has a limit of 2GB. 普通的Web服务器(Tomcat / JBoss / Glassfish / etc)则限制为2GB。 You can configure this, but this still won't and can't remove the limitation on the webbrowser. 您可以配置它,但这仍然不会并且无法消除对Web浏览器的限制。

Your best bet is FTP. 最好的选择是FTP。 If you want to do this by a webpage, consider an applet which utilizes Apache Commons Net FTPClient . 如果要通过网页执行此操作,请考虑使用Apache Commons Net FTPClient小程序 There are several ready-to-use opensource/commercial ones by the way. 顺便说一下,有几种现成的开放源代码/商业代码。

You however still need to take into account that the disk file system on the FTP server side supports that large files. 但是,您仍然需要考虑到FTP服务器端的磁盘文件系统支持该大文件。 FAT32 for example has a limit of 4GB per file. 例如,FAT32的每个文件限制为4GB。 NTFS and several *Nix file systems, however, can go up to 16EB. NTFS和多个* Nix文件系统最多可以达到16EB。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM