Rex's plugins for Construct2
  • Home
  • Map
  • Tutorial/Templates
  • News
  • About

rex_backendless_files

Plugin, ACE table, Discussion thread
Dependence:
rex_backendless_api

Introduction
Files stored in backendless serivice.

Usage
Prepare
Add 
rex_backendless_api to set api id and secret key.

Upload
Call one of these actions to upload data
  • Action:Upload data URL (sample capx)
  • Action:Upload from sprite (sample capx)
  • Action:Upload from file chooser (sample capx), supports multiple files uploading.
  • Action:Upload string (sample capx)
"Condition:On upload" will be triggered while uploading success, get download url of this file by "Expression:LastDownloadURL".
Otherwise "Condition:On upload error" will be triggered while uploading failed, get error message by "Expression:ErrorMessage".

Download
Get download URL by "Expression:DownloadURL".
  • Expression:DownloadURL , return the root url of files storage.
  • Expression:DownloadURL( directoryPath ) , return url of the directory path.
  • Expression:DownloadURL( directoryPath , fileName ) , return url of a specific file.
Access control allow origin
Reference
By default a Backendless backend data is available for all domains. This can be restricted using Backendless console.

Files listing
Sample capx
Follows these steps to get files list-
1. setting list condition:
Sets listing directory path by "Action:Set directory", add file name filter by "Action:Set pattern", default filter is "*.*" to get all files.
2. send request
Call one of these actions to get files list
- Page by page, lines of each page is set by property "Line".
  • Action:Request to page
  • Action:Request current page
  • Action:Request next page
  • Action:Request previous page
- In a range
  • Action:Request in a range
- all
  • Action:Request all
3. get result
"Condition:On get files list" will be triggered when getting files list success, otherwise "Condition:On get files list error" will be triggered.
4. retrieve files list
Uses "Condition:For each files" to retrieve files by these expressions
  • Expression:CurFileName
  • Expression:CurPublicUrl , download url of this file
  • Expression:CurDirectory
  • Expression:CurCreated , created timestamp
  • Expression:CurFileSize , file size in bytes
Or get properties of file by index
  • Expression:Index2FileName( index )
  • Expression:Index2PublicUrl( index )
  • Expression:Index2Directory( index )
  • Expression:Index2Created( index )
  • Expression:Index2FileSize( index )

Copy, Move, or Rename
Call "Action:Copy", "Action:Move", , or "Action:Rename" to move, copy, or rename file or directory.
"Condition:On copy", "Condition:On move", "Condition:On rename" will be triggered when action executing success, get download url of this file by "Expression:LastDownloadURL".
Otherwise "Condition:On copy error", "Condition:On move error", "Condition:On rename error" will be triggered, get error message by "Expression:ErrorMessage".
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 message by "Expression:ErrorMessage".

Create a free web site with Weebly
  • Home
  • Map
  • Tutorial/Templates
  • News
  • About