Yesterday afternoon I started having a problem where my google drive app could no longer update google documents. I can still update other file types like docx or rtf. This also happened to a coworker here but two different users are still able to use the google drive app and update google documents without issue, and we're all using the same build.

I logged into one of the working google accounts instead of my own and was not able to update that same google document that a coworker was able to. However the coworker that was having the same problem as me logged into a different google account and he was able to update google documents with the same build as before.

What the hell has happened here all of a sudden? This was working for us all two days ago.

This is where I request permissions:

GoogleWebAuthorizationBroker.Folder = "Tasks.Auth.Store";
                StoredCredential = GoogleWebAuthorizationBroker.AuthorizeAsync(
                GoogleClientSecrets.Load(stream).Secrets,
                new[] { DriveService.Scope.Drive,
            DriveService.Scope.DriveFile },
                "user",
                CancellationToken.None,
                new SavedDataStore()).Result;

I know the fileID going into it so:

request = service.Files.Get(fileID);
myFile = request.Execute();

While working with google documents I download it as a docx file and so:

if (myFile.MimeType == "application/vnd.google-apps.document")
    myFile.MimeType = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";

And this is where the update happens:

try
        {
            //fileLoc contains the updated contents
            byte[] byteArray = System.IO.File.ReadAllBytes(fileLoc);
            System.IO.MemoryStream stream = new System.IO.MemoryStream(byteArray);
            FilesResource.UpdateMediaUpload updateRequest = service.Files.Update(myFile, fileID, stream, myFile.MimeType);
            //fileID is used to get myFile in the first place; myFile is = to myFile.Id
            updateRequest.Upload();
        }
        catch (Exception e)
        {
            MessageBox.Show("An error occurred: " + e.Message);
        }

This request happens without throwing any error and even updates the timestamp on these files but the content does not update. I am losing my mind trying to figure this out, I don't know what has gone wrong and I have no idea where to start looking.

有帮助吗?

解决方案

There was a temporary glitch, this should be working again now.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top