sadiq79's avatar

Uploaded Image File to S3 download by an link

I had added to s3 bucket im previewing the file but i need a link too for download that file with extensions jpeg ,pdf,png in laravel

0 likes
3 replies
aurawindsurfing's avatar

Hi @sadiq79

S3 does not care what extension the file is. You would have to save it along with S3 id in your database and build it up when downloading.

Hope it helps!

1 like
Tray2's avatar

You can use the download attribute on the link to the image.

<a href="/images/myw3schoolsimage.jpg" download>
2 likes
sadiq79's avatar
$exists = Storage::disk('s3')->exists('file.jpg');

return Storage::download('file.jpg');

return Storage::download('file.jpg', $name, $headers);

Please or to participate in this conversation.