Convert docx to gdoc ( OpenWithLinks = null )

44 views Asked by At

I am uploading a docx file using the Google Drive API. I need to open the document in edit mode but OpenWithLinks is null.

I am using c# client library.

    var mimeType = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
    var filename = "Document1.docx";
    Google.Apis.Drive.v2.Data.File body = new Google.Apis.Drive.v2.Data.File();
    body.Title = filename;        
    body.Description = "Document 1";
    body.MimeType = mimeType;
    body.Parents = new List<Google.Apis.Drive.v2.Data.ParentReference>() { new Google.Apis.Drive.v2.Data.ParentReference() { Id = gSubFolderId } };

    byte[] byteArray = System.IO.File.ReadAllBytes(filename);
    System.IO.MemoryStream stream = new System.IO.MemoryStream(byteArray);

    FilesResource.InsertMediaUpload uploadRequest = service.Files.Insert(body, stream, mimeType);
    uploadRequest.Upload();

And these are the file properties (Note that OpenWithLinks is null :S ) :

Editable: true
    EmbedLink: null
    ETag: "\"V1-oYosm7Hqin5z0Mtb-CnZdXIE/MTQzNDM0ODI4NDc4Mg\""
    ExplicitlyTrashed: null
    ExportLinks: null
    FileExtension: "docx"
    FileSize: 17640
    FolderColorRgb: null
    HeadRevisionId: "0Bxc5uNPKiV0zckhLY01MM3c1azBpb1cxcXkzWnJsVEtLa2xFPQ"
    IconLink: "https://ssl.gstatic.com/docs/doclist/images/icon_10_word_list.png"
    Id: "0Bxc5uNPKiV0zVjhMeDBwUDNBMjg"
    ImageMediaMetadata: null
    IndexableText: null
    Kind: "drive#file"
    Labels: {Google.Apis.Drive.v2.Data.File.LabelsData}
    LastModifyingUser: {Google.Apis.Drive.v2.Data.User}
    LastModifyingUserName: "User 1"
    LastViewedByMeDate: {6/15/2015 4:04:44 PM}
    LastViewedByMeDateRaw: "2015-06-15T06:04:44.782Z"
    MarkedViewedByMeDate: {1/1/1970 10:00:00 AM}
    MarkedViewedByMeDateRaw: "1970-01-01T00:00:00.000Z"
    Md5Checksum: "0fd61ff6879e7c7d1b1cadb5deb313c6"
    MimeType: "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
    ModifiedByMeDate: {6/15/2015 4:04:44 PM}
    ModifiedByMeDateRaw: "2015-06-15T06:04:44.782Z"
    ModifiedDate: {6/15/2015 4:04:44 PM}
    ModifiedDateRaw: "2015-06-15T06:04:44.782Z"
    OpenWithLinks: null
0

There are 0 answers