문제

As of this afternoon I can no longer update google document files, a coworker is also seeing this problem, but two more are seeing it work just fine, we're all running the same build.

Before this afternoon no one had any troubles like that, 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 the update 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.

Does anyone have any idea how I can fix this? I feel like I don't have a clue to go on.

도움이 되었습니까?

해결책

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top