ES2Web.UploadRaw
Upload Raw String
Parameters
data | The raw string to upload. Must be on the Supported Types list. |
Returns
IEnumerator | The IEnumerator for the coroutine. |
Description
Uploads our raw string to the URL specified when creating the ES2Web object without any header data. The string will be uploaded in UTF-8 encoding.
Note: When saving using UploadRaw, you can only access that data using ES2Web.LoadRaw() or by accessing the database directly.
C#
A coroutine to Upload a raw string to the server with a given tag
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
public IEnumerator UploadRawString(string myString, 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.UploadRaw(myString)); 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 raw string to the server with a given tag
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
function UploadRawString(myString : String, 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.UploadRaw(myString)); 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); } } |
Upload Raw Bytes
Parameters
data | The raw bytes to upload. Must be on the Supported Types list. |
Returns
IEnumerator | The IEnumerator for the coroutine. |
Description
Uploads our raw data to the URL specified when creating the ES2Web object without any header data.
Note: When saving using UploadRaw, you can only access that data using ES2Web.LoadRaw() or by accessing the database directly.
C#
A coroutine to Upload raw bytes to the server with a given tag
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
public IEnumerator UploadRawBytes(byte[] myBytes, 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.UploadRaw(myBytes)); 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 raw bytes to the server with a given tag
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
function UploadRawString(myBytes : byte[], 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.UploadRaw(myBytes)); 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); } } |