ES2Web.Upload
Parameters
data | The data to upload. Must be on the Supported Types list. |
Returns
IEnumerator | The IEnumerator for the coroutine. |
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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
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
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
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); } } |