0

Is there a way to show a custom html page or redirect a user when storage throws errors like if file is not available, not sufficient permissions or in case of any other issues when the file can't be accessed/displayed?

So instead of the below

enter image description here

We need to show a custom page with our brand designs.

What are the options here?

vir us
  • 9,920
  • 6
  • 57
  • 66

1 Answers1

1

No, there is not. You are using an API endpoint (download URL) meant for programmatic consumption or inline page insertion, not for loading into a browser to present a full web page.

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441
  • Got you. Is there a way to know if that API will throw an error or return an object without triggering the actual download? – vir us Jan 02 '22 at 15:49
  • I dunno, try a HEAD request? – Doug Stevenson Jan 02 '22 at 18:26
  • thanks, seems to be an option. I've also found this discussion - I'll leave it here in case anyone else might find it useful: https://stackoverflow.com/questions/37751202/how-to-check-if-file-exists-in-firebase-storage – vir us Jan 02 '22 at 19:03