i have a upload script to upload some files to a directory. every file runs through a loop and will be checked if there are errors with the size or ending or even not. in case of no error it will be uploaded.
if (is_array($_FILES ['image'] ['tmp_name'])) {
foreach ( $_FILES ['image'] ['tmp_name'] as $key => $val ) {
...
if (! in_array ( $fileExt, $allowedExtensions )) {
$errors [$fileName] [] = "format not accepted";
}...
if ((count ( $errors1 ) == 0) && (count ( $errors ) === 0)) {
if (move_uploaded_file ( $fileTemp, $fileDst )) {
//...
}
}
}
}
my question is, is there a way to count the number of the uploaded files that successfully ran through that loop? thanks a lot.
You need to count each successful upload.
like below: