ES3Cloud.DownloadFile
Description
Downloads a file from the server, overwriting any existing file stored locally.
Note that all parameters are optional.
If no filePath parameter is provided, it will attempt to download the default file.
If no user parameter is provided, it will download the global file which is not specific to any user.
For more information, see the Uploading and Downloading Files using ES3Cloud guide.
Parameters
filePath | [Optional] The relative or absolute path of the local file we want to download from the server. |
user |
[Optional] The name of the user this file belongs to, if the file is not global. |
password |
[Optional] The password of the user this file belongs to. |
settings |
[Optional] The settings we want to use to override the default settings. |
es3File |
[Optional] The ES3File we want to load our data into. The filename in the settings of the ES3File will be used when downloading. |
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/ES3Cloud.php", "myAPIKey"); // Download a file from the server which is specific to a particular user. yield return StartCoroutine(cloud.DownloadFile("myFile.es3", "myUser", "myUsersPassword")); if(cloud.isError) Debug.LogError(cloud.error); // Download a file from the cloud which is global for all users. yield return StartCoroutine(cloud.DownloadFile("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/ES3Cloud.php", "myAPIKey"); // Download a file from the server which is specific to a particular user. yield cloud.DownloadFile("myFile.es3", "myUser", "myUsersPassword"); if(cloud.isError) Debug.LogError(cloud.error); // Download a file from the cloud which is global for all users. yield cloud.DownloadFile("myGlobalFile.es3"); if(cloud.isError) Debug.LogError(cloud.error); |