rex_firebase_storage
Plugin, ACE table, Discussion thread
Dependence: rex_firebase_apiV3
Dependence: rex_firebase_apiV3
Introduction
File storage in firebase serivice (v3.x only).
File storage in firebase serivice (v3.x only).
Usage
Security rules
User might configure the security rules of firebase storage before using it, see this page for more detail.
User might configure the security rules of firebase storage before using it, see this page for more detail.
Upload
Call one of these actions to upload data into a storage reference
Call one of these actions to upload data into a storage reference
- Action:Upload from data URL (sample capx)
- Action:Upload from sprite (sample capx)
- Action:Upload from file chooser (sample capx)
On uploading completed
"Condition:On upload complete" will be triggered while uploading completed, get download url of this file by "Expression:LastDownloadURL"
"Condition:On upload complete" will be triggered while uploading completed, get download url of this file by "Expression:LastDownloadURL"
On uploading failed
"Condition:On upload error" will be triggered while uploading failed, get error message by "Expression:LastErrorCode", "Expression:LastErrorMessage".
"Condition:On upload error" will be triggered while uploading failed, get error message by "Expression:LastErrorCode", "Expression:LastErrorMessage".
On uploading
"Condition:On upload progress" will be triggered during uploading, get progress percentage by "Expression:Progress", or get the transferred bytes and total bytes by "Expression:TransferredBytes", "Expression:TotalBytes".
"Condition:Is uploading" will return true when uploading.
"Condition:On upload progress" will be triggered during uploading, get progress percentage by "Expression:Progress", or get the transferred bytes and total bytes by "Expression:TransferredBytes", "Expression:TotalBytes".
"Condition:Is uploading" will return true when uploading.
Pause, resume or cancel
Call "Action:Pause", "Action:Resume", "Action:Cancel" to control current uploading task.
Call "Action:Pause", "Action:Resume", "Action:Cancel" to control current uploading task.
Download
Call "Action:Get download url" to get a url of the file.
"Condition:On get download URL" will be triggered while getting url, the result url is put in "Expression:LastDownloadURL"
"Condition:On get download URL error" will be triggered while getting url failed. "Condition:File doesn't exist" will return true under this error triggered while the file does not exist under this storage reference. Get error code by "Expression:LastErrorCode".
Call "Action:Get download url" to get a url of the file.
"Condition:On get download URL" will be triggered while getting url, the result url is put in "Expression:LastDownloadURL"
"Condition:On get download URL error" will be triggered while getting url failed. "Condition:File doesn't exist" will return true under this error triggered while the file does not exist under this storage reference. Get error code by "Expression:LastErrorCode".
Access control allow origin
There might have "access control allow origin" problem if load image from result url in sprite object. Follow this reference to solve it.
There might have "access control allow origin" problem if load image from result url in sprite object. Follow this reference to solve it.
- Install gsutil
- Add cors.json file in local, for example, put in d:\cors.json
- Type command "gsutil cors set d:\cors.json gs://exampleproject.appspot.com" in command line window. Replace exampleproject.appspot.com by your storageBucket link.
Delete
Call "Action:Detete" to delete file at a specific storage reference.
"Condition:On deleted" will be triggered while deleting action completed, otherwise "Condition:On deleted error" will be triggered. Get error code by "Expression:LastErrorCode"
Call "Action:Detete" to delete file at a specific storage reference.
"Condition:On deleted" will be triggered while deleting action completed, otherwise "Condition:On deleted error" will be triggered. Get error code by "Expression:LastErrorCode"
Multiple files uploding
Project could have many rex_firebase_storage object for each data.
Project could have many rex_firebase_storage object for each data.