Upload 1GB files using chunking in PHP

别说谁变了你拦得住时间么 提交于 2019-11-26 20:23:09

plupload is a javascript/php library, and it's quite easy to use and allows chunking.

It uses HTML5 though.

"but I can not find any equivalent of request.getInputStream in PHP. "

fopen('php://input'); perhaps?

I have created a JavaFX client to send large files in chunks of max post size (I am using 2 MB) and a PHP receiver script to assemble the chunks into original file. I am releasing the code under apache license here : http://code.google.com/p/gigaupload/ Feel free to use/modify/distribute.

Amjad Farooq

Try using the bigupload script. It is very easy to integrate and can upload up to 2 Gb in chunks. The chunk size is customizable.

Take a look at tus protocol which is a HTTP based protocol for resumable file uploads so you can carry on where you left off without re-uploading whole data again in case of any interruptions. This protocol has also been adopted by vimeo from May, 2017.

You can find various implementations of the protocol in different languages here. In your case, you can use its javascript client called uppy and use golang or php based server implementation in a server.

How about using a java applet for the uploading and PHP for processing..

You can find an example here for Jupload: http://sourceforge.net/apps/mediawiki/jupload/index.php?title=PHP_Example

you can use this package

it supports resumable chunk upload.

in the examples/js-examples/resumable-chunk-upload example , you can close and re-open the browser and then resume not completed uploads.

You can definitely write a web app that will accept a block of data (even via a POST) then append that block of data to a file. It seems to me that you need some kind of client side app that will take a file and break it up into chunks, then send it to your web service one chunk at a time. However, it seems a lot easier to create an sftp dir, and let clients just sftp up files using some pre-existing client app.

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