Firebase Google Storage Download File Name Content-Disposition

1,082 views
Skip to first unread message

anant.bh...@impactanalytics.co

unread,
Jul 27, 2016, 11:20:43 AM7/27/16
to Firebase Google Group

We are using Firebase Google Cloud Storage Bucket to store our files.

When the logged in user wants the download the file kept inside certain folder Eg: 123/admin/1469611803143/123.xlsx

The url generated will be https://firebasestorage.googleapis.com/v0/b/MYWEBSITE.appspot.com/o/123%2Fadmin%2F1469611803143%2F123.xlsx?alt=media&token=whatever_alpa_numeric_token

As I download this file the file name will be 123%2Fadmin%2F1469611803143%2F123.xlsx

and not 123.xlsx

We have tried using download attribute to change the file name


but this did not change the file name to 123.xlsx



We understand that there are 2 ways around this.


1>Set Content-disposition header while uploading the file. But the contentDisposition variable needs to be set in certain way.

generally the header should have Content-Disposition: attachment; filename="<file name.ext>" 

https://firebase.google.com/docs/storage/web/file-metadata


2> Generate a Signed URL with  response-content-disposition


Can anyone help with this?

Kato Richardson

unread,
Aug 11, 2016, 2:57:42 PM8/11/16
to Firebase Google Group
Hi Anant!

Looks like this was discussed here. The content-disposition trick should work for your needs. What did you need help with beyond that?

☼, Kato

--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-talk+unsubscribe@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/cff22d50-3fcc-4184-b008-e54d30b5d01c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Kato Richardson | Developer Programs Eng | kato...@google.com | 775-235-8398

Reply all
Reply to author
Forward
0 new messages