我想将HTML上传到Google云端硬盘并获取网址。此代码上传很好,它返回文件的URL。但我想在Google Doc查看器中获取文件URL。我是怎么做到的?
File body = new File();
body.Title = Path.GetFileNameWithoutExtension(item);
//body.Description = "A test document";
body.MimeType = "text/html";
byte[] byteArray = System.IO.File.ReadAllBytes(item);
var stream = new MemoryStream(byteArray);
FilesResource.InsertMediaUpload request =
service.Files.Insert(body, stream, "application/vnd.google-apps.document");
request.Convert = true;
request.Upload();
File file = request.ResponseBody;
var id = file.Id;