Hello Again!
I'm having some trouble getting the file uploading to work. I'm using the test script from the documentation:
I've made sure to log in before trying to run this, but I always get the following (unhelpful?) errors:
{"success":false,"message":"An error occurred","errors":[]}
UnityEngine.Debug:Log(Object)
Combu.<DownloadUrl>c__Iterator1:MoveNext() (at Assets/_Ignore/Combu/Scripts/CombuManager.cs:278)
Failed: An error occurred
UnityEngine.Debug:Log(Object)
SaveLoad:<Save>m__0(Boolean, String) (at Assets/Scripts/SaveLoad.cs:28)
Combu.<Update>c__AnonStorey4C:<>m__55(String, String) (at Assets/_Ignore/Combu/Scripts/UserFile.cs:185)
Combu.<DownloadUrl>c__Iterator1:MoveNext() (at Assets/_Ignore/Combu/Scripts/CombuManager.cs:280)
Any idea how to figure out what's wrong and fix it? The SaveLoad.cs file just have a function that runs when I hit F1, which contains the documentation script listed above (near the top of this post). Thanks.
Did you see if the webservice creates the file in the folder "upload"? It may be a permission issue, the upload folder (as well as _logs) must have write permission on the system (if you're running a *nix, then use: chmod -R 777 upload).
FRANCESCO CROCETTI @ SKARED CREATIONS
That fixed it! I can now see a nice little screenshot saved and uploaded to the server. Thank you!
I'd like to ask a little more about what kinds of files I can upload, and how. I see stuff in the code for JSON and Hash but I don't really understand any of it. Can I upload any kind of file type? I'm still trying to lock down how I want to do my level saves for my game. Can I have a basic explanation? I've looked at the code in the documentation but I only really half understand it.
You can upload any type of files and any size, as long as it's allowed by your web server settings (php.ini [google for post and upload allowed size], Web.config on IIS or httpd.conf on Apache/XAMPP). To upload a file you need to pass the bytes array to the method, as it does with the take screenshot example (if it's a file on the sytem storage you can use File.ReadAllBytes).
FRANCESCO CROCETTI @ SKARED CREATIONS