- Home /
How would I upload and download save data to google drive or dropbox directly from Unity?
Hi, I've been stuck on this problem for a while and haven't been able to make headway on it. I'm trying to make it so the user can click a button to upload their saves to either drive or dropbox, and download them again later. I've been through tons of pages about APIs, but couldn't find anything for a Unity PC game. The closest I got was this link (https://github.com/midworld/unity-googledrive) which no longer works. Can anyone help me?
Answer by Bunny83 · May 31, 2016 at 05:47 PM
That's not as easy as you might think. Google drive as well as Dropbox have their own unique APIs to access their services. Both require a quite complex authentication service. The question doesn't really apply to Unity answers since it's not a Unity specific question. Unity uses Mono and as such It's just a question how you get it done in .NET / Mono. Google has a detailed tutorial for a console application.
The google API consists of several libraries. If they are 100% managed libraries you should be able to copy them one to one to Unity.
Thanks for the informative reply! I've got the console application working, but how would I go about integrating it in to Unity?
Answer by Elringus · Nov 15, 2017 at 08:53 PM
Take a look at this project on GitHub: https://github.com/Elringus/UnityGoogleDrive
It works with all the major target platforms (including WebGL) and doesn't use platform-specific precompiled libraries.
Nice one! Are you going to put that on the asset store and maintain it?
Thanks! I'll maintain it on the GitHub for the time being; not sure if there any reason to put on the store (I'm not going to sell it anyway).
Really good project. Nice one.
I've got it working, to upload a file to my drive storage, after a bit of code manipulation of a test script (think some plugins were clashing) with Win10.
I also successfully compiled for Android through cloud build, but running on my phone it just does the first loading sequence (upto 100%), then just sits there. Any idea what could be wrong?
This looks to hopefully handle the first half of my requirements (upload/download data on your own personal Google drive), but can you tell me if it would handle the second half, to basically upload/download data to someone else's Google drive public file? This should be handled at runtime, so if my server gives the app a new user to access, then it could link to there and read their public file (name also given by server).
Incidentally, I would put it on the store if I were you. If you included some working example scenes, then it's definitely worth buying.
please help me, I run on ios 13 error: Request Failed: Authorization error. Thank you so much ;))
[1]: /storage/temp/146600-img-3896.png
Your answer
Follow this Question
Related Questions
Save / Load high score online 2 Answers
How to script a Save/Load option on IPhone? 1 Answer
Saving Game Problem 1 Answer
PlayerPrefsX - Not Saving? 1 Answer
Game and Level State Logic 1 Answer