先前的问题解决了
我下载了一个与Ajax和jQuery一起工作的图像上传脚本。我想限制最多上传到8张图片。请帮帮忙。
下载自:453.html
发布于 2016-03-17 07:08:03
清点所有文件,检查文件是否超过8,如果超过8,发送消息并退出;
类似于
$fileCount = count($_FILES["myfile"]['name']);
if($fileCount>8){
$data['code'] = "failed";
print_r(json_encode($data));exit;
}在ajax中做任何你想做的事。
发布于 2016-03-17 07:27:05
试试这样的东西。
$allfiles = count($_FILES);
if($allfiles > 8)
{
echo "Sorry You can Upload Only 8 images";
}
else{
//your code here
}https://stackoverflow.com/questions/36053517
复制相似问题