Hi,
So I can generate pdf files on my server and save them locally or download to browser. However, instead of storing them on the web server, it would be ideal if the files could be pushed directly to S3.
Currently, I am saving them to local storage path, then uploading the pdf to S3 (using Storage::put to move to AWS S3) and deleting the local copy. Is there a way to save files directly to cloud?
Thanks!
Fixed! In case anyone else is wondering, just use $pdf->output() to stream the file:
$pdf = PDF::loadView('pdf.invoice', $data);
Storage::put($file, $pdf->output());
In my case, default storage has already been setup as "S3" in config
Thanks, this saved my life..phewww
Most helpful comment
Fixed! In case anyone else is wondering, just use $pdf->output() to stream the file:
In my case, default storage has already been setup as "S3" in config