Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google Cloud Storage Force Download

I am storing my files in Google Cloud Storage. I would like to provide downloadable links. For example https://yeketakclub.storage.googleapis.com/audios/yeketak.club-dm7aEYv7R53JRlti3HHn.mp3 one of audio files stored in google cloud storage. But when it is clicked browser tries to open it. Is it possible to force download?

like image 606
torayeff Avatar asked Nov 29 '22 01:11

torayeff


1 Answers

The correct answer is neither of these! (if you don't want to edit a file's metadata) Add this on the end of any signed url:

&response-content-disposition=attachment;

This will make all storage links force a download instead of opening.

like image 92
zackify Avatar answered Dec 16 '22 03:12

zackify