firebasefirebase-storageglitch-frameworkglitch.com

Firebase Storage file 403 using wget but downloadable via browser


I copied the download URL of an image file stored in Firebase Storage, it is accessible and can be download with browser but when I tried to use wget in a Linux server it is getting 403. Which one is at fault in this scenario? Does Firebase Storage domain have issue with this way of accessing file or it is the server running in Linux that is having issue?

wget -O sample.jpeg <THE_DOWNLOAD_URL_OF_FIREBASE_STORAGE_FILE>

I believe this is not a Firebase rule problem since it is still accessible even when I am not authenticated on other browser. The image url also has permanent token. The linux server is a Glitch static website.

Sample image https://firebasestorage.googleapis.com/v0/b/convenient-sabong.appspot.com/o/Devices%2F1666029723328%2FGooglePixelC___1_.jpg?alt=media&token=4751669f-600d-49a1-b031-7387105da7c7

Error enter image description here


Solution

  • If your URL contains any special characters like &, you must enclose your URL in double quotes. The URL in your CLI screenshot does not include the token from the URL. Try:

    wget -O file.ext "https://....?token=***"