Fix bug in multiple file upload example, fixes #2569
This commit is contained in:
parent
baeb7cde6b
commit
d3f566012b
|
|
@ -20,7 +20,7 @@ if (array_key_exists('userfile', $_FILES)) {
|
|||
//Attach multiple files one by one
|
||||
for ($ct = 0, $ctMax = count($_FILES['userfile']['tmp_name']); $ct < $ctMax; $ct++) {
|
||||
//Extract an extension from the provided filename
|
||||
$ext = PHPMailer::mb_pathinfo($_FILES['userfile']['name'], PATHINFO_EXTENSION);
|
||||
$ext = PHPMailer::mb_pathinfo($_FILES['userfile']['name'][$ct], PATHINFO_EXTENSION);
|
||||
//Define a safe location to move the uploaded file to, preserving the extension
|
||||
$uploadfile = tempnam(sys_get_temp_dir(), hash('sha256', $_FILES['userfile']['name'][$ct])) . '.' . $ext;
|
||||
$filename = $_FILES['userfile']['name'][$ct];
|
||||
|
|
|
|||
Loading…
Reference in New Issue