本文介绍了Google Apis V2 html mime / type的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我上传doc,xls文件,但我不明白如何上传HTML文件。此代码上传文件,但不预览文件。它说 - 我们道歉预览不可用。我必须设置什么类型的mime?



I upload doc,xls files but i dont understand how upload html files. This code upload file but dont preview file. Its say- "We apologize Preview not available". Whats mime type i must set ?

 if (extension == ".htm" || extension == ".html")
                    {

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);
System.IO.MemoryStream stream = new System.IO.MemoryStream(byteArray);
FilesResource.InsertMediaUpload request = service.Files.Insert(body, stream,
"application/vnd.google-apps.file");
                        request.Convert = true;

推荐答案


这篇关于Google Apis V2 html mime / type的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 11:38
查看更多