ES2Web

public ES2Web(string url, ES2Settings settings=null)

Parameters

url The URL pointing to our ES2.php file.

settings

Optional. A user-created ES2Settings object containing options not specified in path.

bool isDone Whether our ES2Web object has finished performing it’s operation.

bool

isError Whether our ES2Web object returned an error.

string

error The error message of the error which occurred, if any.

string

errorCode The error code for the error which occurred, if any. For example: 04

HashType

hashType What type of hashing to use for the password. Accepted values are:
ES2Web.HashType.MD5 (Default)
ES2Web.HashType.None"

Upload/Download Methods

ES2Web.Upload Initiates an upload.
ES2Web.UploadRaw Initiates a raw upload.
ES2Web.UploadFile Uploads a local file to the server.
ES2Web.UploadImage Uploads an image (Texture2D) to the server as a PNG.
ES2Web.Download Initiates a download.
ES2Web.DownloadFilenames Initiates a download of filenames.

Load Methods

ES2Web.Load Loads data from the downloaded data.
ES2Web.LoadArray Loads an array from the downloaded data.
ES2Web.Load2DArray Loads a 2D array from the downloaded data.
ES2Web.Load3DArray Loads a 3D array from the downloaded data.
ES2Web.LoadList Loads a List from the downloaded data.
ES2Web.LoadDictionary Loads a Dictionary from the downloaded data.
ES2Web.LoadHashSet Loads a HashSet from the downloaded data.
ES2Web.LoadQueue Loads a Queue from the downloaded data.
ES2Web.LoadStack Loads a Stack from the downloaded data.
ES2Web.LoadRaw Loads the raw bytes from the downloaded data.

Other Methods

ES2Web.SaveToFile Saves the downloaded data to a local file.
ES2Web.AppendToFile Appends the downloaded data to a local file.
ES2Web.Delete Deletes the specified data from the database.
ES2Web.GetFilenames Gets all stored filenames on the server.

These are the error codes which can be encountered using ES2Web. You can check for errors using the isError, errorCode and error variables of ES2Web.

00 Unity has reported an upload error. This might be because URL does not exist, or server is down. See message for details.
01 Could not connect to database. Database or login details are incorrect.
02 Username and password specified in Unity does not match that specified in ES2.php file.
03 No data was received at ES2.php.
04 ES2 MySQL table could not be found on database.
05 The data you are trying to load does not exist.

The ES2Web object is used to upload and download data from a MySQL database, using the ES2.php and ES2.sql files supplied with Easy Save.

Note: See Saving And Loading From Web for details on how to install ES2.php and ES2.sql.
Note: Requires knowledge of Coroutines to use.

C#

A coroutine to Upload a Mesh to the server with a given tag

A coroutine which Downloads all data stored in myFile.txt on the server

Deletes data from the server with the given tag

 

JS

A coroutine to Upload a Mesh to the server with a given tag

A coroutine which Downloads all data stored in myFile.txt on the server
Deletes data from the server with the given tag