简体   繁体   English

php上传大文件

[英]php uploading large files

I'm stuck here with file uploading problem. 我被困在文件上传问题。 I've searched for answers but found only "increasing post_max_size and upload_max_filesize" suggestion and that doesn't work for me. 我搜索了答案,但发现只有“增加post_max_size和upload_max_filesize”的建议,这对我不起作用。 I can't get large files uploaded(approx. around 150mb+), the following are my php.ini settings and my environments 我无法上传大文件(大约150mb +),以下是我的php.ini设置和我的环境

php.ini php.ini中

 - max_input_time 300
 - max_execution_time 600
 - memory_limit 1024M
 - upload_max_filesize 1512M
 - post_max_size 2048M

environments 环境

 - Webserver: XAMPP
 - PHPFramwork: CodeIgniter

I've also tried many other php.ini configurations. 我也尝试了很多其他的php.ini配置。 The file uploading class that I've built received posted file data from XmlHttpResponse request using xhr.send(file). 我构建的文件上传类使用xhr.send(文件)从XmlHttpResponse请求中发布了文件数据。 I've debugged infos with firebug header is normal, post totally empty (normally it should be the file data, an in-read-able text), cookies are the ci_session cookies, and no xhr response text at all. 我用firebug标头调试了infos是正常的,post完全是空的(通常它应该是文件数据,可读文本),cookies是ci_session cookie,根本没有xhr响应文本。 I've write a script that will return some response no matter what, though. 我编写了一个脚本,无论如何都会返回一些响应。

I'm no experts in this, rather a newbie. 我不是这方面的专家,而是新手。 This all information at hand that I can give to you guys. 我掌握的所有信息都可以给你们。 So, any ideas on what happen in this? 那么,关于这件事发生的任何想法? I'm really stuck here can't get this problem solve. 我真的卡在这里无法解决这个问题。

If there should be any info that I can look for and give it to you to get this problem solved do tell me so. 如果有任何我可以寻找的信息并且给你解决这个问题请告诉我。

thx in advance. thx提前。

instead uploading with standard form try uploading with xhr object (as you said) but using file chunk method to send file to server, in this way theorically you should have not upload limits. 而是使用标准表格上传尝试使用xhr对象上传(如您所说)但使用文件块方法将文件发送到服务器,这样理论上您应该没有上传限制。 Try this upload jquery plugin that provides also php scripts: 试试这个上传jquery插件,它也提供了php脚本:

http://code.google.com/p/ax-jquery-multiuploader/ REMOVE BECAUSE CANNOT MANTAIN http://code.google.com/p/ax-jquery-multiuploader/删除,因为无法理解

New link (free): http://www.albanx.com/download.php?item_id=4 新链接(免费): http//www.albanx.com/download.php?item_id = 4

Documentation: http://www.albanx.com/ajaxuploader/doc.php 文档: http//www.albanx.com/ajaxuploader/doc.php

If you are uploading very large files such as a few GB, then there are actually browser side limitations. 如果要上传非常大的文件(例如几GB),则实际上存在浏览器端限制。 It appears that most modern browsers are 2GB - 4GB . 看来大多数现代浏览器都是2GB - 4GB You should probably look into chunking (uploading parts of the file like a few MB at a time) your file uploads. 你可能应该研究一下你的文件上传的分块(一次上传部分文件)。

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

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