Basically i am downloading email from user folder with IMAP. I can get all the information I need, minus the attachments.
I don't know how to handle them before sending them to javascript (front-end), I'll probably have to convert them to base64 or something.
According to this documentation, would I be able to create a javascript file object with the information provided (size, content, name, type)?
But how to send? that is the question.
$email = email::on('user');
$attachs = $oMessage->getAttachments();
if($attachs->count()){
foreach ($attachs as $attach) {
$attachs_vetor[] = base64_encode(implode($attach->getAttributes()));
}
}
return ['attachments'=>$attachs_vetor];
I tried something like that, but I think it made my rollback process difficult in javascript.
source https://stackoverflow.com/questions/68595923/getting-attachment-with-laravel-imap-and-sending-to-javascript
Comments
Post a Comment