ES2Web.DownloadFilenames
public IEnumerator DownloadFilenames()
Returns
[table th=”0″]IEnumerator,”The IEnumerator for the coroutine.”[/table]
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
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);
}