0
I have the following code in PHP, using Phpmailer to send by email files of a multiple upload, is working the problem is that in the email the name of the files is with the name of the folder tmp for example : "/tmp/php/Z9MDY7" instead of appearing the name of the file that was attached, but in the folder of the server to which these same files go the name is correct, which could be?
Code:
$total = count($_FILES['pdfanexo']['name']);
for($i=0; $i<$total; $i++) {
$tmpFilePath = $_FILES['pdfanexo']['tmp_name'][$i];
if ($tmpFilePath != ""){
$newFilePath = "Marcas/" .$vregistro. $d. "/". $_FILES['pdfanexo']['name'][$i];
if(move_uploaded_file($tmpFilePath, $newFilePath)) {
$mail->addAttachment($newFilePath, $tmpFilePath); //Attachment Documentos Múltiplo Upload (PDF-DOCUMENT)
}
}
}
Perfect, thank you!
– HBretone