Large file upload though html form (more than 2 GB)

青春壹個敷衍的年華 提交于 2019-11-26 23:56:43

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.

Konga Raju

Use HTML5 File API to upload large files. which has the concept of slicing, so that you can upload large files.

var reader= new FileReader();
reader.onload=function(e){

//do whatever you want with result
}
var blob = file.slice(startingByte, endindByte);//slicing file
reader.readAsBinaryString(blob);

FileSystem Tutorial

File API tutorial

we created a webapplication (https) (using django/python) which uploads bulk files in to sqlserver database. For this we read the file in chunks, transferred to server through sftp and performed bulk inserts into sqlserver. We benchmarked it for 1 gb filesize and end to process was over in around 1 minute or so.

Use Arivu server for java backend server gradle -> compile 'org.arivu:nioserver:1.0.3' , File size no constraint. Any size can be handled.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!