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

symfony - InvalidConfigurationException in SecurityExtension.php line 429: No authentication listener registered for firewall "secured_area" -

angular ui router - 10 digest iterations reached in angularjs when using $state.go -

javascript - Handling constructor related functions while testing with mocha and sinon -