ES2Web.Upload
public IEnumerator Upload(T data)
Parameters
[table th=”0″]data,”The data to upload. Must be on the Supported Types list.[/table]
Returns
[table th=”0″]IEnumerator,”The IEnumerator for the coroutine.”[/table]
Description
Uploads our data to the URL specified when creating the ES2Web object.
C#
A coroutine to Upload a Mesh to the server with a given tag
public IEnumerator UploadMesh(Mesh mesh, string tag)
{
string myURL = "https://www.server.com/ES2.php?webfilename=myFile.txt";
ES2Web web = new ES2Web(myURL + "&tag=" + tag);
// Start uploading our data and wait for it to finish.
yield return StartCoroutine(web.Upload(mesh));
if(web.isError)
{
// Enter your own code to handle errors here.
// For a list of error codes, see www.moodkie.com/easysave/ES2Web.ErrorCodes.php
Debug.LogError(web.errorCode + ":" + web.error);
}
}
JS
A coroutine to Upload a Mesh to the server with a given tag
function UploadMesh(mesh : Mesh, tag : String)
{
var myURL = "https://www.server.com/ES2.php?webfilename=myFile.txt";
var web = new ES2Web(myURL + "&tag=" + tag);
// Start uploading our data and wait for it to finish.
yield StartCoroutine(web.Upload(mesh));
if(web.isError)
{
// Enter your own code to handle errors here.
// For a list of error codes, see www.moodkie.com/easysave/ES2Web.ErrorCodes.php
Debug.LogError(web.errorCode + ":" + web.error);
}
}