在PHP中使用分块上传1GB文件 [英] Upload 1GB files using chunking in PHP
问题描述
我有一个Web应用程序,可以接受最大4 MB的文件上传.服务器端脚本是PHP,Web服务器是NGINX.许多用户要求大幅提高此限制,以允许上传视频等.
I have a web application that accepts file uploads of up to 4 MB. The server side script is PHP and web server is NGINX. Many users have requested to increase this limit drastically to allow upload of video etc.
但是,用PHP解决此问题似乎没有简单的解决方案.首先,在客户端,我正在寻找可以在传输过程中对文件进行分块的东西. SWFUpload似乎没有做到这一点.我想我可以使用Java FX来流式上传( http://blogs.oracle.com/rakeshmenonp/entry /javafx_upload_file ),但在PHP中找不到任何等效的request.getInputStream.
However there seems to be no easy solution for this problem with PHP. First, on the client side I am looking for something that would allow me to chunk files during transfer. SWFUpload does not seem to do that. I guess I can stream uploads using Java FX (http://blogs.oracle.com/rakeshmenonp/entry/javafx_upload_file) but I can not find any equivalent of request.getInputStream in PHP.
增加浏览器的client_post限制或php.ini上载或max_execution
时间并不是真正针对大文件(〜1GB)的解决方案,因为浏览器可能会超时并想到存储在内存中的所有blob.
Increasing browser client_post limits or php.ini upload or max_execution
times is not really a solution for really large files (~ 1GB) because maybe the browser will time out and think of all those blobs stored in memory.
有什么方法可以在服务器端使用PHP解决此问题?感谢您的答复.
Is there any way to solve this problem using PHP on server side? I would appreciate your replies.
推荐答案
plupload 是一个javascript/php库,而且非常易于使用,并且可以进行分块.
plupload is a javascript/php library, and it's quite easy to use and allows chunking.
尽管它使用HTML5.
It uses HTML5 though.
这篇关于在PHP中使用分块上传1GB文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!