我有允许这些文件类型的 upload.php 文件:
$allowedExtensions = array("mp3","mp4","jpg","jpeg","gif","png");
它可以正确执行上传,但是当上传的文件大于 5mb(块大小设置为 5mb)时,它会停止工作,除非我用 BLOB 扩展我的数组(Javascript 控制台返回此错误作为来自 upload.php 的响应 - 这就是我知道什么是问题):
$allowedExtensions = array("mp3","mp4","jpg","jpeg","gif","png","blob");
谁能解释一下那个 BLOB 是什么?这是存储在服务器上的某种上传 PART/CHUNK 吗?我应该包括其他任何惊喜allowedExtensions
吗?
我的upload.php 来自Plupload.com:https://github.com/downloads/moxiecode/plupload/plupload_1_5_4.zip (解压缩,转到/examples/ 并打开upload.php)。我只是通过添加这个来扩展它:
foreach($_FILES as $file){
if($file['tmp_name'] > ''){
if(!in_array(end(explode(".", strtolower($file['name']))), $allowedExtensions)){
die($file['name'].' is not an allowed file type!');
}
}
}