我使用php上传大约30张左右的多张图片。在上传之前,我已将图像压缩为100kb。当我尝试通过Android上传图片时,我没有收到任何错误。只有19张图像传输到服务器,而不是其他图像。我使用cPanel共享主机帐户,它不是一个网站只有PHP。
如何上传超过19张图片?
/////// images
if (!empty($images_names_str)) {
if( get_magic_quotes_gpc() ) {
$images_names_str = stripslashes( $images_names_str );
}
$newstr = json_decode( $images_names_str,true );
$i = -1;
foreach($newstr as $item) { //foreach element in $arr
$i++;
$name = $item['name']; //etc
$path = $item['path'];
$file_path1 = "/home/public_html/images/";
// Use
if ($_FILES['image'.$i]['error'] === UPLOAD_ERR_OK) {
//uploading successfully done
$moveResult = move_uploaded_file($_FILES['image'.$i]['tmp_name'], $file_path1.$name);
fputs($fp,"File has been moved from to" . $file_path1.$name. "\n");
} else {
fputs($fp,$_FILES['image'.$i]['error'].$i." ERROR: File not moved correctly".$file_path1.$name. "\n");
}
}
echo "done";
}