I try to upload an image to the Firebase storage from an URL (with To do so i need a File or Blob, but whenever I try EDIT: And I actually want to upload a whole directory of files, that’s why i can’t upload them via Console asked May 19, 2017 at 12:41
2 Try using the fetch API. You can use it like so:
As of July 2022, the fetch API has about 97% browser support worldwide, with basically just IE missing it. You can get that to near 100% using a polyfill, which I recommend if you're still targeting IE. answered May 19, 2017 at 12:48
James KrausJames Kraus 3,23319 silver badges27 bronze badges 3 @James answer is correct but it is not compatible with all browsers. You can try this jQuery solution :
answered Dec 10, 2017 at 23:23
Ruan CarlosRuan Carlos 4755 silver badges9 bronze badges 1 It did not work until I added credentials
answered Sep 6, 2018 at 12:46
stanimirspstanimirsp 2,0402 gold badges21 silver badges32 bronze badges
answered Nov 10, 2020 at 15:13
Stéphane LaurentStéphane Laurent 62.5k14 gold badges102 silver badges202 bronze badges If you are using homepage in package.json then ypu have to use: CurrentUrl: http://localhost:3008/tempAppHomepageFromPackageJson/
objectUrl is the local url to file. For example to show in runtime you uploading file. Second solution is (if you have no homepage in package.json):
Third solution (Not working in safari):
Enjoy ;) answered Apr 16, 2021 at 12:24
voltdevvoltdev 2481 gold badge4 silver badges9 bronze badges Not the answer you're looking for? Browse other questions tagged javascript file url blob firebase-storage or ask your own question. |