PHP上传大文件 [英] php uploading large files

查看:94
本文介绍了PHP上传大文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里遇到文件上传问题.我已经搜索了答案,但是只发现增加post_max_size和upload_max_filesize"的建议,这对我不起作用.我无法上传大文件(大约150mb以上),以下是我的php.ini设置和环境

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. I can't get large files uploaded(approx. around 150mb+), the following are my php.ini settings and my environments

php.ini

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

环境

 - Webserver: XAMPP
 - PHPFramwork: CodeIgniter

我还尝试了许多其他的php.ini配置.我建立的文件上传类使用xhr.send(file)从XmlHttpResponse请求接收发布的文件数据.我用firebug标头调试过的信息是正常的,发布的信息完全为空(通常应该是文件数据,可读文本),cookies是ci_session cookie,根本没有xhr响应文本.我编写了一个脚本,无论如何都会返回一些响应.

I’ve also tried many other php.ini configurations. The file uploading class that I’ve built received posted file data from XmlHttpResponse request using xhr.send(file). 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. 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.

提前.

推荐答案

而不是使用标准格式进行上传,请尝试使用xhr对象进行上传(如您所说),但是使用文件块方法将文件发送到服务器,从理论上讲,您应该没有上传限制.试试这个还提供php脚本的上载jquery插件:

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. Try this upload jquery plugin that provides also php scripts:

http://code.google.com/p/ax-jquery-multiuploader /由于无法维护而删除

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

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

这篇关于PHP上传大文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆