简体   繁体   中英

View Google apps files

I am using the google drive sdk to upload files with the application I'm developing. The upload works, and if I use the ListRequest I can see that my files are there.

But when I log in to google in my browser, I don't see any of the files I uploaded and I'm logged in with the account that created the app.

Is there any way to see those files? do I have to add some access to the google account?

When you upload a file, it isn't given a parent by default. Files without parents can only be found by searching for them (type in the exact title and you should find it). what you need to do is add 'root' as a parent and your problem should be solved.

If anyone is having the same problem, I also had to impersonate my gmail account in the ServiceAccount credentials.

        ServiceAccountCredential.Initializer init = new ServiceAccountCredential.Initializer("serviceAccount@developer.gserviceaccount.com")
        {
            Scopes = new[] { "https://www.googleapis.com/auth/drive" },
            User = "myemail@gmail.com"
        };

Then I was able to use Dan's solution.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM