Search Unity

Google Drive SDK for Unity (free, open-sourced)

Discussion in 'Assets and Asset Store' started by Elringus, Feb 1, 2018.

  1. Elringus

    Elringus

    Joined:
    Oct 3, 2012
    Posts:
    483
    Project on GitHub: github.com/Elringus/UnityGoogleDrive
    Any questions and/or suggestions are welcome in this thread or via the GitHub issues.

    Google Drive API library for listing, searching, creating, uploading, editing, copying, downloading, deleting and exporting files on the user's drive from within Unity game engine.

    Works with Unity version 5.6 and higher. Supports all the major platforms: Windows, Mac, Linux, iOS, Android and WebGL.

    The design mostly follows the official Google APIs Client Library for .NET:
    Code (CSharp):
    1. // Listing files.
    2. GoogleDriveFiles.List().Send().OnDone += fileList => ...;
    3.  
    4. // Uploading a file.
    5. var file = new UnityGoogleDrive.Data.File() { Name = "Image.png", Content = rawImageData };
    6. GoogleDriveFiles.Create(file).Send();
    7.  
    8. // Downloading a file.
    9. GoogleDriveFiles.Download(fileId).Send().OnDone += file => ...;
    10.  
    11. // All the requests are compatible with the .NET 4 asynchronous model.
    12. var aboutData = await GoogleDriveAbout.Get().Send();
    Three authentication schemes are used: browser redirection for WebGL builds, custom URI for iOS/Android and local loopback requests for other platforms. All the credentials are stored in a scriptable object; editor script provides shortcuts to create and manage Google Console App, allows to parse credentials JSON to skip manual copy-pasting and edit common settings:



    Automated integration tests cover the main features:



    The project is open-sourced and I’m planning to support it until Google will make an official Drive API library for Unity or it’ll become possible to use the current official .NET API library in Unity seamlessly on all the platforms.
     
    Last edited: Oct 5, 2018
    AlterMannn, zalogic, yuliyF and 3 others like this.
  2. Elringus

    Elringus

    Joined:
    Oct 3, 2012
    Posts:
    483
    Taking advantage of this thread, I would like to ask for an advice regarding JSON handling. Currently I’m forced to use a third-party library (Json.Net.Unity3D) to de-/serialize JSON data, as Unity’s built-in one doesn’t suport nullable types (and they’re heavily used in the data API to represent properties not included to a request/response). While the library itself works fine and is .NET 2.0 compatible, the performance is not that good comparing to the native Unity solution and I was really up to making a ‘pure’ solution, without any third-party dependencies. Maybe someone here has an idea how to make nullable types work with the Unity’s JSON tools without complicating code base too much?

    -----------------------------------------------------------------------------------------------------

    I've created a feedback request to add support for nullable types to JsonUtility: https://feedback.unity3d.com/suggestions/add-support-for-nullable-types-to-jsonutility

    Will really appreciate any votes you can spend on this idea :)

     
    Last edited: Jun 3, 2018
    nedhaljalali likes this.
  3. nedhaljalali

    nedhaljalali

    Joined:
    Sep 14, 2017
    Posts:
    13
    wish u good luck ELRINGUS ..
    i tried it .. it works fine
     
    Elringus likes this.
  4. nedhaljalali

    nedhaljalali

    Joined:
    Sep 14, 2017
    Posts:
    13
    hmmm
    what about if i wanna upload SQLite File ?
     
  5. Elringus

    Elringus

    Joined:
    Oct 3, 2012
    Posts:
    483
    It doesn't really matter what type of file to upload, you just send the binary content and (optionally) specify mime type.
     
    nedhaljalali likes this.
  6. nedhaljalali

    nedhaljalali

    Joined:
    Sep 14, 2017
    Posts:
    13
    i really love to make that .. can u explain more ..

    i think i need to change that
    public Texture2D ImageToUpload;

    if you can help me with that ..i am new in programming i know maybe 10% lol
     

    Attached Files:

    Last edited: Feb 21, 2018
    yuliyF likes this.
  7. Elringus

    Elringus

    Joined:
    Oct 3, 2012
    Posts:
    483
    You can omit mime type and use any name you like. What really matters is the binary data you're uploading ('Content' property); you'll have to get the content of the file (as byte array) you wish to upload and use it. If the file is stored locally, you can probably use File.ReadAllBytes method.
     
    nedhaljalali likes this.
  8. nedhaljalali

    nedhaljalali

    Joined:
    Sep 14, 2017
    Posts:
    13
    ok thanks i will try to do that i hope i can ..
    i did not understand anything but i will read about it
    and come back to u soon ..
     
  9. Bandara_Dev

    Bandara_Dev

    Joined:
    Dec 4, 2017
    Posts:
    2
    Hi Elringus

    Thank you so much for the sdk! I only have one question: You say it works for all major Plattforms, so does that include Android and iOS too?

    Cheers,
    Daniel
     
  10. Elringus

    Elringus

    Joined:
    Oct 3, 2012
    Posts:
    483
    Yep, it should work on those platforms. Personally, I've only tested it on PC, Android and WebGL, but it should also work on iOS. If you find any issues, please report them here or via GitHub and I'll take a look.
     
    Bandara_Dev likes this.
  11. Bandara_Dev

    Bandara_Dev

    Joined:
    Dec 4, 2017
    Posts:
    2
    Nice, thanks again! I will give it a try soon and let you know if I also find anything useful regarding the JSON handling issue ;)
     
    Elringus likes this.
  12. blanx

    blanx

    Joined:
    Feb 26, 2016
    Posts:
    73
    Hi, I have big trouble to make this working on new iOS devices. I don't get the access tokens when accepting the browser. I switch back to the app, but nothing happens.
    But this only encounters when using wifi. When I disable it and use mobile internet I don't have these troubles.

    Running current Xcode beta 4 and unity 2017.3.1 p3

    Code (CSharp):
    1. 2018-03-15 22:48:06.105395+0100 artemplategd[1251:354052] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
    2. 2018-03-15 22:48:06.107633+0100 artemplategd[1251:354052] [MC] Reading from public effective user settings.
    3. 2018-03-15 22:48:12.169209+0100 artemplategd[1251:354244] [BoringSSL] Function boringssl_session_errorlog: line 2881 [boringssl_session_read] SSL_ERROR_ZERO_RETURN(6): operation failed because the connection was cleanly shut down with a close_notify alert
    4. 2018-03-15 22:48:12.169375+0100 artemplategd[1251:354244] [BoringSSL] Function boringssl_session_errorlog: line 2881 [boringssl_session_read] SSL_ERROR_ZERO_RETURN(6): operation failed because the connection was cleanly shut down with a close_notify alert
    5. -> applicationWillResignActive()
    6. ar_session_interrupted
    7. UnityEngine.XR.iOS.UnityARSessionNativeInterface:_ar_session_interrupted()
    8. (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
    9.  
    10. -> applicationDidEnterBackground()
    11. 2018-03-15 22:48:19.235886+0100 artemplategd[1251:354244] TIC Read Status [4:0x1c0173500]: 1:57
    12. 2018-03-15 22:48:19.237008+0100 artemplategd[1251:354244] Task <1D325C96-96E3-49E0-BE05-5B93FA65A352>.<0> HTTP load failed (error code: -1005 [1:57])
    13. 2018-03-15 22:48:19.237605+0100 artemplategd[1251:354434] NSURLConnection finished with error - code -1005
    14. -> applicationWillEnterForeground()
    15. 2018-03-15 22:48:21.366019+0100 artemplategd[1251:354434] TIC Read Status [5:0x1cc173440]: 1:57
    16. 2018-03-15 22:48:21.371482+0100 artemplategd[1251:354434] Task <E63E62CB-1CB6-4B58-B1A7-D5EF94964323>.<0> HTTP load failed (error code: -1005 [4:-4])
    17. 2018-03-15 22:48:21.382858+0100 artemplategd[1251:354751] NSURLConnection finished with error - code -1005
     
  13. Elringus

    Elringus

    Joined:
    Oct 3, 2012
    Posts:
    483
    Thank you for reporting this! Can you please clarify whether this happens only on specific iOS devices (you've mentioned the new ones, but which exactly)?
     
  14. blanx

    blanx

    Joined:
    Feb 26, 2016
    Posts:
    73
    iPhone X (running 11.3 15E5167f) is the trouble maker. The one that worked was an iPhone 7 (running 11.3 15E5211a) .

    And an iPad with version 11.3 15E5189f had the same problem
     
  15. Elringus

    Elringus

    Joined:
    Oct 3, 2012
    Posts:
    483
    I see, thank you for the clarification! Unfortunately, I don't have those devices and can't check this myself. I have a guess, that the issue could be with resolving the 'localhost' alias. Can you please check one more thing? Try to change the loopback uri (https://github.com/Elringus/UnityGo...horization/LoopbackAccessTokenProvider.cs#L19) to "http://127.0.0.1" and also add this address to the "Authorised redirect URIs" on the Google APIs portal (where you've added "http://localhost") and try to login one more time.
     
  16. blanx

    blanx

    Joined:
    Feb 26, 2016
    Posts:
    73
    Testing now.

    Besides this maybe this hast to be added to info.plist?

    <key>NSAppTransportSecurity</key>
    <dict>
    <key>NSAllowsLocalNetworking</key>
    <true/>
    </dict>
     
  17. Elringus

    Elringus

    Joined:
    Oct 3, 2012
    Posts:
    483
    Yeah, you could try adding those records. The app will definitely need local networking access. Not sure about the NSAppTransportSecurity though. Still, I'm not exactly an expert with those settings :)
     
  18. blanx

    blanx

    Joined:
    Feb 26, 2016
    Posts:
    73
    Not sure if I am doing something wrong. No luck yet. Added both things to the build.

    Code (CSharp):
    1.  
     
  19. Elringus

    Elringus

    Joined:
    Oct 3, 2012
    Posts:
    483
    Hmm, if this only happens when connected to a WiFi, I guess there could be something wrong with the router or firewall (on both router or device) config. Not sure what exactly, though. I've updated the repo on github, so it should now log the exact error you get from the google auth reponse. Most likely it will be something about the missing token, but still could be helpful.
     
  20. blanx

    blanx

    Joined:
    Feb 26, 2016
    Posts:
    73
    Think I got it now. Have to do some more tests. Had to add this. Maybe the newer devices or iOS versions have more security

    Code (CSharp):
    1.   <key>NSAppTransportSecurity</key>
    2.   <dict>
    3.     <key>NSAllowsLocalNetworking</key>
    4.     <true/>
    5.     <key>NSAllowsArbitraryLoads</key>
    6.     <true/>
    7.     <key>NSExceptionDomains</key>
    8.     <dict>
    9.       <key>127.0.0.1</key>
    10.       <dict>
    11.         <key>NSExceptionAllowsInsecureHTTPLoads</key>
    12.         <true/>
    13.         <key>NSIncludesSubdomains</key>
    14.         <true/>
    15.       </dict>
    16.       <key>localhost</key>
    17.       <dict>
    18.         <key>NSExceptionAllowsInsecureHTTPLoads</key>
    19.         <true/>
    20.         <key>NSIncludesSubdomains</key>
    21.         <true/>
    22.       </dict>
    23.     </dict>
    24.   </dict>
     
  21. Elringus

    Elringus

    Joined:
    Oct 3, 2012
    Posts:
    483
    Uh, "NSExceptionAllowsInsecureHTTPLoads" -- it could also be related to the fact that I'm using http for the loopback. I wonder if just changing it to the https will do the trick... I've found this discussion on the matter: https://stackoverflow.com/questions...nsecurehttploads-not-working-for-ip-addresses Guess there could be problems when publishing apps with this kind of exceptions.
     
  22. blanx

    blanx

    Joined:
    Feb 26, 2016
    Posts:
    73
    Strange. On the iPhone I had some success but the iPad was still failing.
    Now with the new version from git the browser does not even open up.

    Code (CSharp):
    1. Setting up 1 worker threads for Enlighten.
    2.   Thread -> id: 170c47000 -> priority: 1
    3. UnloadTime: 1.921541 ms
    4. 2018-03-16 00:52:44.060709+0100 artemplategd[1391:393527] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
    5. 2018-03-16 00:52:44.062170+0100 artemplategd[1391:393527] [MC] Reading from public effective user settings.
    6. -> applicationWillResignActive()
    7. -> applicationDidBecomeActive()
    8. 2018-03-16 00:52:50.950742+0100 artemplategd[1391:393909] [BoringSSL] Function boringssl_session_errorlog: line 2881 [boringssl_session_read] SSL_ERROR_ZERO_RETURN(6): operation failed because the connection was cleanly shut down with a close_notify alert
    9. 2018-03-16 00:52:50.950803+0100 artemplategd[1391:393909] [BoringSSL] Function boringssl_session_errorlog: line 2881 [boringssl_session_read] SSL_ERROR_ZERO_RETURN(6): operation failed because the connection was cleanly shut down with a close_notify alert
    10. UnityGoogleDrive: Failed to execute authorization procedure. Check application settings and credentials.
    11. UnityGoogleDrive.AuthController:HandleAccessTokenProviderDone(IAccessTokenProvider)
    12. UnityEngine.AsyncOperation:InvokeCompletionEvent()
     
  23. Elringus

    Elringus

    Joined:
    Oct 3, 2012
    Posts:
    483
    Well, that's strange, I've only added Debug.LogError call for the response error. Make sure the GoogleDriveSettings asset is configured correctly (it could've been overriden with a new copy when you've updated the package).
     
  24. blanx

    blanx

    Joined:
    Feb 26, 2016
    Posts:
    73
    You are right. It was the overwritten asset file

    Here is the new log
    Code (CSharp):
    1. 2018-03-16 01:08:18.571140+0100 artemplategd[1426:403022] [MC] System group container for systemgroup.com.apple.configurationprofiles path is /private/var/containers/Shared/SystemGroup/systemgroup.com.apple.configurationprofiles
    2. 2018-03-16 01:08:18.571877+0100 artemplategd[1426:403022] [MC] Reading from public effective user settings.
    3. -> applicationWillResignActive()
    4. -> applicationDidBecomeActive()
    5. 2018-03-16 01:08:25.770199+0100 artemplategd[1426:403351] [BoringSSL] Function boringssl_session_errorlog: line 2881 [boringssl_session_read] SSL_ERROR_ZERO_RETURN(6): operation failed because the connection was cleanly shut down with a close_notify alert
    6. 2018-03-16 01:08:25.770250+0100 artemplategd[1426:403351] [BoringSSL] Function boringssl_session_errorlog: line 2881 [boringssl_session_read] SSL_ERROR_ZERO_RETURN(6): operation failed because the connection was cleanly shut down with a close_notify alert
    7. -> applicationWillResignActive()
    8. ar_session_interrupted
    9. UnityEngine.XR.iOS.UnityARSessionNativeInterface:_ar_session_interrupted()
    10. (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
    11.  
    12. -> applicationDidEnterBackground()
    13. -> applicationWillEnterForeground()
    14. 2018-03-16 01:08:39.079772+0100 artemplategd[1426:403358] TIC Read Status [5:0x1d016df80]: 1:57
    15. 2018-03-16 01:08:39.080468+0100 artemplategd[1426:403358] TIC Read Status [4:0x1cc164140]: 1:57
    16. 2018-03-16 01:08:39.082043+0100 artemplategd[1426:403358] Task <0F78A173-8397-49B6-8063-C5C6C9EFD66D>.<0> HTTP load failed (error code: -1005 [4:-4])
    17. 2018-03-16 01:08:39.083965+0100 artemplategd[1426:403358] Task <B4D46AB9-C3F1-40B6-9459-86B73A8F1ECD>.<0> HTTP load failed (error code: -1005 [4:-4])
    18. 2018-03-16 01:08:39.086290+0100 artemplategd[1426:403752] NSURLConnection finished with error - code -1005
    19. 2018-03-16 01:08:39.092752+0100 artemplategd[1426:403752] NSURLConnection finished with error - code -1005
    20. ar_session_interruption_ended
    21. UnityEngine.XR.iOS.UnityARSessionNativeInterface:_ar_session_interruption_ended()
    22. (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
    23.  
    24. -> applicationDidBecomeActive()
    25. Unknown Error
    26. UnityGoogleDrive.AuthCodeExchanger:HandleRequestComplete(AsyncOperation)
    27. UnityEngine.AsyncOperation:InvokeCompletionEvent()
    28. (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
    29.  
    30. UnityGoogleDrive: Failed to exchange authorization code.
    31. UnityGoogleDrive.LoopbackAccessTokenProvider:HandleAuthCodeExchanged(AuthCodeExchanger)
    32. UnityEngine.AsyncOperation:InvokeCompletionEvent()
    33. (Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/DebugBindings.gen.cpp Line: 51)
    34.  
    35. UnityGoogleDrive: Failed to execute authorization procedure. Check application settings and credentials.
    36. UnityGoogleDrive.AuthController:HandleAccessTokenProviderDone(IAccessTokenProvider)
    37. UnityEngine.AsyncOperation:InvokeCompletionEvent()
     
  25. Elringus

    Elringus

    Joined:
    Oct 3, 2012
    Posts:
    483
    "Unknown Error", huh. Looks like the auth response error wasn't that helpful, after all :)
    Does this happen even with the exceptions you've added and only on the iPad?
     
  26. blanx

    blanx

    Joined:
    Feb 26, 2016
    Posts:
    73
    Yes can't get it running. Maybe a port problem?
     
  27. Elringus

    Elringus

    Joined:
    Oct 3, 2012
    Posts:
    483
    Well, if this only happens on iPad, but not on iPhone; under the same OS, environment and using the same build... I'm a bit at loss here. Maybe some security settings on iPad? Or the router is handling the devices differently.

    Regarding the port: currently a random unused port is retrieved via this method, but you can manually set any specific port number here (just for the sake of testing).
     
  28. bianco81

    bianco81

    Joined:
    Mar 20, 2018
    Posts:
    4
    Hello, I'm trying to use it, but I have some problems:

    1) On iOS I can't login: I select my google account and I allow the app to manage google drive, but safari gives me the following error message: "safari can not open the page because the secure connection to the server has failed". I already tryed to change the LOOPBACK_URI to https, set the port to a specific number and add the "NSAppTransportSecurity" key as described by blanx, but the problem persists..
    I get the same error on WiFi and mobile connection.

    2) On Windows and Android I can login, list files and download files, but I can't upload a file: I get the following responseText in HandleResponseData function (GoogleDriveRequest.cs line 152): "Invalid multipart request with 0 mime parts."

    Where am I wrong?
     
  29. Elringus

    Elringus

    Joined:
    Oct 3, 2012
    Posts:
    483
    Does the "safari can not open the page because the secure connection to the server has failed" error appear when using https loopback? I guess that won't work, as local server won't provide a valid ssl cert. Can you please specify which device and iOS version you're using?

    Regarding the upload issue, looks like there is a problem with the sent raw data. What is the file size you're trying to upload? Also, make sure you're actually reading the file content as byte array.
     
  30. bianco81

    bianco81

    Joined:
    Mar 20, 2018
    Posts:
    4
    Yes, it appear also with https loopback. I'm using an iPad mini 2 (iOS 11.2.6) and an iPad Pro (12.9 inch) (2nd generation).

    Regarding the upload issue, I get it using small files. I read the file data using System.IO.File.ReadAllBytes() and Texture2D.EncodeToPNG(). I get the same error building and running the project downloaded from github.

    Regards.
     
    Last edited: Mar 20, 2018
  31. Elringus

    Elringus

    Joined:
    Oct 3, 2012
    Posts:
    483
    Well, I've just tested and completed the auth without any problems on my iPhone 5S (iOS 11.2.6) via both WiFi and mobile connection. I don't have any other Apple devices, unfortunately. Though, I guess it's hardly possible that the issue is hardware-specific. For the test, I've used Unity 5.6.5 release build without any special permissions or settings.

    I also wasn't able to reproduce the upload issue on my android device (xperia tablet). The test script from the project run fine and the image file was uploaded to the drive. Can you provide some additional info (android device you're using, android version, Unity version, build settings and link to the script from the github project that fails to run)?
     
  32. bianco81

    bianco81

    Joined:
    Mar 20, 2018
    Posts:
    4
    Hello,
    Which iOS SDK version are you using to build the iOS app? I'm using iOS SDK 11.2.
    I'm building the project with Unity 5.6.0f3.

    Regarding the upload issue, I tested the app with:
    - 2 Windows 10 PCs
    - HTC One M9 (Android 7.0)
    - HUAWEI P9 Lite (Android 7.0)

    I downloaded the project from the following links:
    https://github.com/Elringus/UnityGoogleDrive
    https://github.com/Elringus/UnityGo...load/v0.3-alpha/UnityGoogleDrive.unitypackage

    First of all I tryed opening and buildind the Unity project from the first link (https://github.com/Elringus/UnityGoogleDrive) without any change, just open, parse the credentials JSON file and build for windows.

    Regarding the upload issue, I tryed to edit your TestFilesCreate.cs code to upload an empty file and it worked:

    private void Upload ()
    {
    //var content = ImageToUpload.EncodeToPNG();
    var file = new UnityGoogleDrive.Data.File() { Name = "TestUnityGoogleDriveFilesUpload.png", Content = null, MimeType = "image/png" };
    request = GoogleDriveFiles.Create(file);
    request.Fields = new List<string> { "id", "name", "size", "createdTime" };
    request.Send().OnDone += PrintResult;
    }
     
  33. Elringus

    Elringus

    Joined:
    Oct 3, 2012
    Posts:
    483
    Try checking whether "ImageToUpload" var is valid. Maybe the asset reference got corrupted or something.
     
  34. bianco81

    bianco81

    Joined:
    Mar 20, 2018
    Posts:
    4
    The ImageToUpload var is valid, I tryed also with other files..

    Can the upload problem depends on the POST intead of PUT method?
     
  35. Elringus

    Elringus

    Joined:
    Oct 3, 2012
    Posts:
    483
    You could try using other http methods, though they're tied to the google API and I'm not sure that will work. I still can't reproduce the issue on my side, unfortunately. I've tried following your steps (downloading the project from github and running it as-is), but the file still uploads just fine both in editor and on android/ios devices.
     
  36. NatsupyYui

    NatsupyYui

    Joined:
    Jul 11, 2017
    Posts:
    18
    Hi, @Elringus Have any way to update files, if I uploaded the file name: Test.zip, and after 5m or 1day... I update that file and upload it again, drive will have 2 files have name "Test.zip"
    Edit: in my way, search that file by name and get id of it, delete that id, and then upload new file again, but when I sharing that file in another folder(moving file to another folder), the file in that folder will be deleted, so I hope have a function allow update a file. Thank you so much!
     
    Last edited: Mar 22, 2018
  37. Elringus

    Elringus

    Joined:
    Oct 3, 2012
    Posts:
    483
    Sure, just use the Update request.
     
  38. NatsupyYui

    NatsupyYui

    Joined:
    Jul 11, 2017
    Posts:
    18
    ah yes, thank you so much xD
     
  39. NatsupyYui

    NatsupyYui

    Joined:
    Jul 11, 2017
    Posts:
    18
    ah sorry for another question, the value CreatedTime seem to get the timezone in the US, have any way to get UTC time?
     
  40. Elringus

    Elringus

    Joined:
    Oct 3, 2012
    Posts:
    483
  41. NatsupyYui

    NatsupyYui

    Joined:
    Jul 11, 2017
    Posts:
    18
  42. Elringus

    Elringus

    Joined:
    Oct 3, 2012
    Posts:
    483
    Initial datetime values returned by the drive API are all in UTC, but I guess the DateTime class uses local timezone by default.
     
  43. NatsupyYui

    NatsupyYui

    Joined:
    Jul 11, 2017
    Posts:
    18
    ah I was mistaken, it's UTC time, but when I do UpdateRequest, CreateTime was not changing, and trying to debug all value Time(ModifiedTime..) they're returning null, so have any way to get timeUpdate
     
  44. Elringus

    Elringus

    Joined:
    Oct 3, 2012
    Posts:
    483
    You have to explicitly require fields in order for the drive api to return them (using 'fields' property of the request object). More info here: https://developers.google.com/drive/v3/web/performance#partial
     
  45. NatsupyYui

    NatsupyYui

    Joined:
    Jul 11, 2017
    Posts:
    18
  46. Chiraruki

    Chiraruki

    Joined:
    Dec 21, 2017
    Posts:
    2
    hi! i already figure it out how to upload .db files, my only problem is how can i download it and save it to a specific folder?
     
  47. Chiraruki

    Chiraruki

    Joined:
    Dec 21, 2017
    Posts:
    2
    i already figure it out, :)
     
  48. unity_StcI7KInAK1uFg

    unity_StcI7KInAK1uFg

    Joined:
    May 10, 2018
    Posts:
    2
    Hey, can we access public files using just public API key? with this.
     
  49. Elringus

    Elringus

    Joined:
    Oct 3, 2012
    Posts:
    483
    Most likely not. As far as I understand, no matter what files you try to access, you need to do that under some user account, therefore auth is required.
     
  50. mikko_forsman

    mikko_forsman

    Joined:
    Jul 10, 2017
    Posts:
    22
    Hi, this seems like a great tool, thank you for this!

    I have one question though, is there a possibility to somehow query the top level team drives? For example, I have 4 "root level" team drive folders, but I can't seem to find a way to query for those top level items, and they are not visible in GoogleDriveFiles.List() -query even if I specify request.Corpora = "user,allTeamDrives". Am I doing something wrong, or is there another method that I should use for finding those root level team drive folders? The items that are inside those team drives are visible though, but I would like a method for determining those top folders as well so I can use corpora "teamDrive" for single team drive.

    EDIT: I'm looking for a method that accomplishes this:
    https://developers.google.com/drive/v3/reference/teamdrives/list

    Best regards,
    Mikko Forsman
     
    Last edited: May 14, 2018