Google Apis V2 html mime / type [英] Google Apis V2 html mime/type

查看:90
本文介绍了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;

推荐答案

有问题在内容类型?它们都由IANA支持和维护:

http:// www .iana.org / assignments / media-types / media-types.xhtml [ ^ ]。



参见:

http://en.wikipedia.org/wiki/Internet_media_type [ ^ ],

http: //en.wikipedia.org/wiki/IANA [ ^ ]。



-SA
Any questions on content-type? They all are supported and maintained by IANA:
http://www.iana.org/assignments/media-types/media-types.xhtml[^].

See also:
http://en.wikipedia.org/wiki/Internet_media_type[^],
http://en.wikipedia.org/wiki/IANA[^].

—SA


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

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆