Skip to content
Advertisement

Laravel 5.1 – how to download pdf file from S3 bucket

I am using Laravel’s Storage facade and I am able to upload the pdf to S3 and I am also able to get() its contents but I cannot display or download it to the end user as an actual pdf file. It just looks like raw data. Here is the code:

JavaScript

How can this be done? I have checked several articles (and SO) and none of them have worked for me.

Advertisement

Answer

I think something like this will do the job in L5.2:

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement