i make a template in which i select multiple files and i make php page in which i upload the files but when i upload the files it gives me error like
Warning: pathinfo() expects parameter 1 to be string, array given in C:\xampp\htdocs\jobboard\system\user-scripts\classifieds\apply_now.php on line 67
here is my code:
<input type="file" name="file_tmp[]" multiple />
and here is my apply_now.php:
if (!empty($_FILES['file_tmp']['name'])){
$fileFormats = explode(',',SJB_System::getSettingByName('file_valid_types'));
foreach ( $_FILES['file_tmp']['name'] as $file ) {
$fileInfo = pathinfo($file);
if ( !in_array(strtolower($fileInfo['extension']), $fileFormats) ) {
$errors['NOT_SUPPORTED_FILE_FORMAT'] = strtolower($fileInfo['extension']) . ' ' . SJB_I18N::getInstance()->gettext(null, 'is not in an acceptable file format');
}
}
}