I have a public bucket, that I use to host public user content.
I want to give users the ability to download those files, by clicking a link, which opens the gcp page, that starts the download automatically. For this the content-disposition header needs to be set.
I would also like to set the filename of the downloaded file.
Is there a way to handle this within gcp?
I know I could generate a signed url: Google Cloud Storage: download a file with a different name, and set the desired headers, but I don't think this is the proper solution. From my understanding signed urls should be used, when accessing protected resources. Is there a way to get the download link easily?
I currently handle this on my own server, but I would like to let gcp handle it. Here is a demo url of a cloud file: https://storage.googleapis.com/just-demo-bucket-14512/Big_Buck_Bunny_1080_10s_5MB.mp4
router.get('/download', (req, res) => {
res.setHeader("content-disposition", "attachment; filename=cool.mp4");
request('https://storage.googleapis.com/just-demo-bucket-14512/Big_Buck_Bunny_1080_10s_5MB.mp4').pipe(res);
})