Downloading a File
You can use one of the following ways to download a file from Firebase Storage:
useDownloadLink
hook to get the link to downloaduseDownloadBlob
hook to directly download the bytes to process it yourselfuseDownloadBytes
hook to directly download the bytes to process it yourselfStorageDownloadLink
component
useDownloadBlob
vs. useDownloadBytes
useDownloadBlob
uses getBlob
function in Firebase Storage under the hood while useDownloadBytes
uses getBytes
.
So, useDownloadBlob
returns Blob
as useDownloadBytes
returns ArrayBuffer
.
Generally speaking, both data types represent array of bytes but have subtle differences. You can refer to this Stackoverflow answer to learn about the difference.