php - Laravel download file from S3 route (not open in browser) -


i have following route load file given url, need download file (mp4, jpg, pdf) rather open in browsers in built viewer.

// download cdn route route::get('cdn/{url}', function($url)     {            return redirect::away($url);         })->where('url', '(.*)'); 

all files stored externally apparently resource::download() wouldn't work.

all have available me amazon url: https://mybucket.s3.amazonaws.com/folder/filename.pdf

any suggestions on how force browser download file s3?

in case simple anchor link downloading file ...

<a href="https://mybucket.s3.amazonaws.com/folder/filename.pdf"> file name </a> 

Comments

Popular posts from this blog

mysql - FireDac error 314 - but DLLs are in program directory -

git - How to list all releases of public repository with GitHub API V3 -

c++ - Getting C2512 "no default constructor" for `ClassA` error on the first parentheses of constructor for `ClassB`? -