ES2Web.DownloadFilenames
Returns
IEnumerator | The IEnumerator for the coroutine. |
Description
Downloads our filenames from the URL specified when creating the ES2Web object.
To be using in conjunction with ES2Web.GetFilenames().
C#
A coroutine which downloads all data stored in myFile.txt on the server
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
public IEnumerator LogFilenames() { ES2Web web = new ES2Web("https://www.server.com/ES2.php"); // Start downloading our filenames and wait for it to finish. yield return StartCoroutine(web.DownloadFilenames()); if(web.isError) { // Enter your own code to handle errors here. Debug.LogError(web.errorCode + ":" + web.error); } // Now get our filenames as an array ... string[] filenames = web.GetFilenames(); // ... and log them to console. foreach(string filename in filenames) Debug.Log(filename); } |