我使用dropzone.js来处理前端的上传部分,使用jquery。
我的测试情况是:
Upload a 34 MB file. Works fine
Upload a 27 MB file. Works fine
Upload two files, each of them are 5 MB. Works fine
Upload two files, 34 MB + 27 MB. *Fail* , $_Files is an empty array
这里是jQuery代码:
<script>
$(document).ready(function() {
Dropzone.options.myAwesomeDropzone = {
autoProcessQueue: false,
url: '<?= site_url("admin/video/upload"); ?>',
addRemoveLinks: true,
previewsContainer: ".dropzone-previews",
uploadMultiple: true,
parallelUploads: 50,
maxFilesize: 500, //500MB
acceptedFiles: 'video/*',
maxFiles: 100,
init: function() {
var myDropzone = this;
myDropzone.on("success", function (file, response) {
$("#success, #fail").hide();
$("#" + response).show();
});
myDropzone.on("maxfilesexceeded", function (file) {
this.removeFile(file);
});
$("#submit-all").click(function (e) {
e.preventDefault();
e.stopPropagation();
myDropzone.processQueue();
});
}
}
});
</script>
这里是PHP代码
public function upload() {
die(var_dump($_FILES));
}
那么,为什么$ _Files是空的以及如何解决它?非常感谢。
可能的答案在这里:[http://stackoverflow.com/a/6135485/3648578](http://stackoverflow.com/a/6135485/3648578) – kosmos