Skip to content
This repository has been archived by the owner on Jan 10, 2022. It is now read-only.

Can I return a base64 instead of saving the file? #6

Closed
zeusworkspace opened this issue Apr 18, 2018 · 2 comments
Closed

Can I return a base64 instead of saving the file? #6

zeusworkspace opened this issue Apr 18, 2018 · 2 comments

Comments

@zeusworkspace
Copy link

zeusworkspace commented Apr 18, 2018

I'm using PHPSpreadsheet to generate an Excel file that I want to attach to a mail message, together with a bunch of PDF files(using Mpdf).

With Mpdf I can simply do: return base64_encode($mpdf->Output())

and attach it to the email with:

 $file = base64_decode($this->actiongetPdfFile($postData['billing_profile']));

$message->attachContent($file, ['fileName' => 'file.pdf', 'contentType' => 'data:application/pdf']);

Is there a way to do something similar with PHPSpreadsheet (without the need to save the file to disk before)?

I saw that suggestions saying that it was possible using $objWriter->save('php://output');, but this did not work with this plugin.

I believe that there is no further documentation aside from what is already on the initial page, right?

@Et3rnel
Copy link

Et3rnel commented Mar 12, 2020

Did you find any solution to send the file as an attachment without having to saving it on the disk ?

@darviscommerce
Copy link

I am intrested too :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants