Web Variable Upload/Download Help

Easy Save 2 has been replaced by Easy Save 3, so is no longer supported.
Locked
Syntax
Posts: 1
Joined: Tue Sep 24, 2013 5:16 pm

Web Variable Upload/Download Help

Post by Syntax »

Hi,

Ok I understand how to save/load multiple variables to a local file by using tags e.g. ES2.Save("SavedData.txt?tag=coins"); ES2.Save("SavedData.txt?tag=level");
But what I cant figure out is how to do the same for a web save/load, I read the documentation and saw the example for a Mesh, but I still don't understand how to save multiple variables to web. Could someone give me and example? p.s.(I have set up the database and it is working correctly).
User avatar
Joel
Moodkie Staff
Posts: 4852
Joined: Wed Nov 07, 2012 10:32 pm

Re: Web Variable Upload/Download Help

Post by Joel »

Hi Syntax,

When saving multiple pieces of data to web, you simply provide a tag in the same way as you would when saving normally, except we add it when specifying the ES2Web object.

If you take a look at the examples on the Saving and Loading from Web Guide, you'll see that the two Save and Load coroutines we create accept a tag parameter:
  • UploadMesh(Mesh mesh, string tag)
  • DownloadMesh(string tag)
Inside each of these methods, we simply append the tag parameter to the end of the URL when creating the ES3Web object, like this:
ES2Web web = new ES2Web(myURL + "&tag=" + tag);
I should also note that you cannot upload an entire file to the database, but must instead upload each tag separately. You can, however, download an entire file and then load the tags from it using the ES2Web.Load(string tag) methods.

It might also be worth checking out the ES2Web reference, as this also contains many examples.

All the best,
Joel
Locked