ES3Cloud Class
Description
Allows uploading and downloading of file to and from cloud storage.
This requires that an ES3.php file and MySQL tables are installed on your server.
For more information, see the Uploading and Downloading Files using ES3Cloud guide.
For most circumstances, you will only need to use the ES3Cloud.Sync method.
Properties
isError | Whether an error occurred after the last operation was performed. |
error | Contains an error message if an error occurred. |
errorCode | Contains an error code if an error occurred. |
data | Contains any data downloaded by the previous operation. |
text | Contains any data downloaded by the previous operation, as a UTF8 string. |
timestamp | Contains a timestamp after calling the DownloadTimestamp method." |
filenames | Contains an array of filenames after calling the DownloadFilenames method |
Constructors
ES3Cloud Constructor | Creates an ES3Cloud object. |
Sync Methods
ES3Cloud.Sync | Synchronises a local file with the server. |
Other Methods
ES3Cloud.UploadFile | Uploads a local file to the server. |
ES3Cloud.DownloadFile | Downloads a file from the server and stores it as a local file. |
ES3Cloud.DeleteFile | Removes a file from the server. |
ES3Cloud.RenameFile | Renames a file on the server. |
ES3Cloud.DownloadFilenames | Downloads an array of all of the file names on the server for a user. |
ES3Cloud.SearchFilenames | Downloads an array of all of the file names on the server for a user which match a search pattern. |
ES3Cloud.DownloadTimestamp | Downloads the date and time a given file was updated. |
ES3Cloud.AddPOSTField | Adds a POST field to the request for custom implementations. |
Examples
C#
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
// Create a new ES3Cloud object with the URL to our ES3.php file. var cloud = new ES3Cloud("https://www.myserver.com/ES3.php", "myAPIKey"); // Synchronise a local file with the cloud for a particular user. yield return StartCoroutine(cloud.Sync("myFile.es3", "myUser", "myUsersPassword")); if(cloud.isError) Debug.LogError(cloud.error); // Synchronise another local file, but make it global for all users. yield return StartCoroutine(cloud.Sync("myGlobalFile.es3")); if(cloud.isError) Debug.LogError(cloud.error); |
JS
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
// Create a new ES3Cloud object with the URL to our ES3.php file. var cloud = new ES3Cloud("https://www.myserver.com/ES3.php", "myAPIKey"); // Synchronise a local file with the cloud for a particular user. yield cloud.Sync("myFile.es3", "myUser", "myUsersPassword"); if(cloud.isError) Debug.LogError(cloud.error); // Synchronise another local file, but make it global for all users. yield cloud.Sync("myGlobalFile.es3"); if(cloud.isError) Debug.LogError(cloud.error); |