Is there any way to generate a public url for a pdf file from firebase storage. The url it gives me right now is this
But we can see this contains a token and this means there is some session/authentication involved.
const publicUrl = format(`https://storage.googleapis.com/${bucket.name}/${blob.name}`); res. status(200). send(publicUrl); });
To generate a new Download URL, you need to call the getDownloadURL method on a reference: import storage from '@react-native-firebase/storage'; const url = await storage(). ref('images/profile-1. png').
If you want the file path on firebase storage to access it via storage reference and not URL, you can use taskSnapshot. getStorage().
The token is not an authentication token, nor is it for any session management, it's simply for obfuscation. All these URLs are public, and can be revoked and new tokens generated through the console.
You can delete the token, still get access to the file.
https://firebasestorage.googleapis.com/v0/b/techmlearnings.appspot.com/o/pdfs%2FUMLNotationSummary.pdf?alt=media
I don't know why if I delete "alt=media", it doesn't work
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With