I am currently working on a project that stores files stored in a database in the form of blocks. I need to attach a file to email and send it via PHPMailer. I am familiar with $mail->addAttachment() , however this function seems to only accept a file path that I donβt have. I was wondering if there is a way to manipulate the blob and serve this function?
I appreciate any suggestions, thanks in advance!
The following file successfully creates a Save As dialog box for the file you want to add:
header("Content-disposition: attachment; filename={$filename}.{$file_ext}"); header("Content-type: application/octet-stream"); echo $pdf['data']; exit;
php phpmailer blob
Anchovylegend
source share