Upload files to Cloud Storage from WordPress
If you are interested in the Integrate Firebase PRO version, read the full updated documentation: https://firebase-wordpress-docs.readthedocs.io/
Demo: https://wordpress.dalenguyen.me/
- Article 1: How to integrate Firebase to WordPress
- Article 2: How to Retrieve Data from Firestore and Display on WordPress
- Article 3: How to Work With Firebase Custom Claims in WordPress
- Article 4: Save Data from WordPress to Firebase (Realtime + Firestore)
- Article 5: Firebase WordPress User Integration
- Article 6: How to Management Firebase Users in WordPress Dashboard
- Article 7: How to Sync Data from WordPress to Firebase
- Article 8: One-Click Login to WordPress & Firebase Or Via Email Link
- Article 9: Upload files to Cloud Storage from WordPress
- Article 10: Remote URL Login to Firebase & WordPress
- Article 11: 2 Ways to Add Firebase Authentication to WordPress & WooCommerce
- Article 12: How to Send WooCommerce Purchase Data to Firebase
- Article 13: Create & Manage Firebase Database from WordPress
Upload files from WordPress to Cloud Storage is similar to Save Data from WordPress to Firebase. Everything can be done through Contact Form 7. However, you can design your custom form to suit your needs.
Enable Cloud Storage
In the general tab, you have to add the Storage Bucket from your firebase project, then check the option for Storage under Firebase Services.
Upload Files to Cloud Storage
This is an example of Contact Form 7 from uploading images to Cloud Storage and save the path to firestore.
// This form will create a path of the file to "users" collection
// If you want to generate a random id, you can leave out the documentId
// The file will be uploaded to "wpImages/documentId/timestamp+filename" path under Storage
[hidden collectionName "users"]
[hidden documentId "some-random-id"]
[hidden databaseType "firestore"]
[hidden fileType "imageUrl"]
[file imageUrl limit:1mb filetypes:gif|png|jpg|jpeg]
[submit "Upload File"]
After submitting the file, it will be uploaded to Cloud Storage under wpImages/som-random-id path. The image name will be prefixed with a timestamp.