-
Notifications
You must be signed in to change notification settings - Fork 16
E.6 Delete Files
Of course you can also delete files from Firebase Storage.
Note: By default, Firebase Storage buckets require Firebase Authentication to upload files. You can change your Firebase Storage Security Rules to allow unauthenticated access. Since the default Google App Engine app and Firebase share this bucket, configuring public access may make newly uploaded App Engine files publicly accessible as well. Be sure to restrict access to your Storage bucket again when you set up authentication.
To delete a file, first create a reference. to that file. Then call the delete() method on that reference.
var rootRef:StorageReference = Storage.getReference();
var imgRef:StorageReference = rootRef.child("images/img.png");
imgRef.remove(onDeleteSuccess, onDeleteFailed);
function onDeleteFailed(e:StorageEvents):void
{
trace("onDeleteFailed with errorCode '" + e.errorCode + "' and msg: " + e.msg);
}
function onDeleteSuccess(e:StorageEvents):void
{
trace("onDeleteSuccess");
}
Note: Deleting a file is a permenant action! If you care about restoring deleted files, make sure to back up your files, or enable object versioning on your Google Cloud Storage bucket.
Enjoy building Air apps – With ♥ from MyFlashLabs Team
Introduction to Firebase ANEs collection for Adobe Air apps
Get Started with Firebase Core in AIR
- Prerequisites
- Add Firebase to your app
- Add the Firebase SDK
- Init Firebase Core
- Available ANEs
- Managing Firebase iid
Get Started with Authentication
- Add Authentication
- Init Authentication
- Manage Users
- Phone Number
- Custom Auth
- Anonymous Auth
- State in Email Actions
- Email Link Authentication
Get Started with FCM + OneSignal
- Add FCM ANE
- Init FCM ANE
- Send Your 1st Message
- Send Msg to Topics
- Understanding FCM Messages
- init OneSignal
- Add Firestore
- Init Firestore
- Add Data
- Transactions & Batches
- Delete Data
- Manage the Console
- Get Data
- Get Realtime Updates
- Simple and Compound
- Order and Limit Data
- Paginate Data
- Manage Indexes
- Secure Data
- Offline Data
- Where to Go From Here
Get Started with Realtime Database
- Add Realtime Database
- Init Realtime Database
- Structure Your Database
- Save Data
- Retrieve Data
- Enable Offline Capabilities
Get Started with Remote Config
- Add Storage ANE
- Init Storage ANE
- Upload Files to Storage
- Download Files to Air
- Use File Metadata
- Delete Files