![]() I had the intention to make a concole project but I missclick and made a WPF project. Jamboard files are now supported in Drive File Stream. 'Open with Google Drive' in the right click context menu now opens in Google Docs instead of Google Drive Preview for Microsoft Office files (doc, docx, ppt, pptx, xls, xlsm, xlsx). I've checked the permissions but I put them here in case I forgot something: private readonly string Scopes = ") See DefaultMountPoint in Configure Drive File Stream. I've also tried with various streams, first I used only the FileStream, then I tried both the ways you can see in the code. The local path fullPath comes from a FileInfo.GetFullPath() beforehand, and I've checked it exists and it's correctly updated locally at runtime with a breakpoint.Īs you can see, first I tried to set MimeType and Parents directly in the google File object, then I read about the non-writable fields so I deleted that part of the code. The Google Drive for Desktop service (formerly known as Google File Stream) is a desktop solution created by Google which allows users to quickly access. The file is a XML witch I first download, fetching the Id and Parents, and then modify locally so I want to update it. ![]() I haven't touched the commented lines so you can see what have I tried. MimeType = regKey.GetValue("Content Type").ToString() If (regKey != null & regKey.GetValue("Content Type") != null) String ext = System.IO.Path.GetExtension(fileName).ToLower() Private string GetMimeType(string fileName) Var progress = await request.UploadAsync() Request.AddParents = string.Join(",", parents) Var request = _(file, id, stream, mimeT) //. Using (var stream = new MemoryStream(byteArray)) await fStream.ReadAsync(byteArray, 0, (int)fStream.Length) byte byteArray = new byte īyte byteArray = System.IO.File.ReadAllBytes(fullPath) ![]() using (var fStream = new FileStream(fullPath, FileMode.Open, FileAccess.Read, FileShare.Read, 4096, true)) 3.Data.File file = new 3.Data.File() įile.Name = System.IO.Path.GetFileName(fullPath) I'm trying to update a file on google drive with this code: private async Task UpdateFileAsync(string fullPath, IList parents, string id)
0 Comments
Leave a Reply. |