Upload & Download Files to a Web Server using ES3 Cloud

Using the MySQL tables and PHP files included with Easy Save 3, you’re able to upload, download, and sync files with a database on a server.

Installation

  1. Place the ES3Cloud.php file on your server
    • The ES3Cloud.php file is found in the Assets/Plugins/Easy Save 3/Web folder in your project.
  2. Navigate to the file in a web browser
    • i.e. https://www.yourserver.com/ES3Cloud.php
  3. Follow the instructions by entering your database details
    • If your server does not support certain features, you may be asked to manually add the tables to the database, and manually create an ES3Variables.php file.
  4. Take note of the API key you are given when the installation completes
    • This can also be found in the ES3Variables.php file.
  5. You’re ready to use ES3 Cloud from your Unity project

Syncing Files

You can synchronize a local file with the server using the ES3Cloud.Sync method:

  • If the local file is newer than the file on the server, or no file exists on the server:
    • The file on the server will be overwritten with the local file.
  • If the file on the server is newer than the local file, or no file exists locally:
    • The local file will be overwritten with the file on the server.

C#

JS

Other Methods

Methods are provided to allow more direct control of the uploading and downloading process.

See the Other Methods section of the ES3Cloud page for more information.

Handling Errors

After calling an ES3Cloud coroutine, you should always confirm the request was successful by checking the ES3Cloud.isError variable.

If an error occurred, an error code and error message will be stored in the ES3Cloud.errorCode and ES3Cloud.error variables.

For more information on error codes, see the ES3Cloud.errorCode page.

Managing Users

ES3Cloud provides optional user and password parameters, allowing you to store data which is unique to a user.

ES3Cloud does not contain any login system functionality, so you may need to integrate your project with a login system to generate a username and password to the user.

For security reasons, a hash of the username and password are sent to the server rather than the username and password itself. If you wish to send the raw username and password to the server so that you can use them in a custom PHP script, add them as POST variables using the ES3Cloud.AddPOSTField method.

If no username or password is specified, the file is assumed to be global.