Laravel-medialibrary: Force Download S3 with getTemporaryUrl()

Created on 26 Feb 2018  路  2Comments  路  Source: spatie/laravel-medialibrary

All of my S3 files are private by default. Is there a method, or way, to force download a file using getTemporaryUrl()?

Most helpful comment

@timgavin: Yes there is

$media->getTemporaryUrl(now()->addMinute(), '', [
    'ResponseContentType' => 'application/octet-stream',
])

All 2 comments

Currently there is not.

@timgavin: Yes there is

$media->getTemporaryUrl(now()->addMinute(), '', [
    'ResponseContentType' => 'application/octet-stream',
])
Was this page helpful?
0 / 5 - 0 ratings