To download a file, first create a Firebase Storage reference to the file you want to download.
Once you have a reference, you can download files from Firebase Storage by calling
getFile(). You can also download the file directly from the URL
using a standard AS3 loader.
Download the file to a
ByteArray with the
getBytes() method. This is the easiest way
to download a file, but it must load the entire contents of your file into memory.
If you request a file larger than your app's available memory, your app will crash.
To protect against memory issues,
getBytes() takes a maximum amount of bytes to
download. Set the maximum size to something you know your app can handle, or use
another download method.
getBytescannot be paused or canceled and will not dispatch the equivalent progress or paused events.
To get access to the byte data you should listen for the
In your handler you will have access to the byte data via the
getFile() method downloads a file directly to a local device.
Use this if your users want to have access to the file while offline or to share
the file in a different app.
getFile() returns a
DownloadTask which you can use
to manage your download and monitor the status of the download.
getFilewill have access to all the functionality defined including progress and paused events.
A download task dispatches
DownloadTaskEvents to indicate completion, progress, and errors:
Events are dispatched with a
This object is an immutable view of the task at the time the event occurred.
In addition to starting downloads, you can pause, resume, and cancel uploads
cancel() methods. Pause and resume
events raise pause and progress state changes respectively. Canceling a
download causes the download to fail with an error indicating that the download