在 Google Drive 上显示 HTML 文件?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/41868313/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Display an HTML file on Google Drive?
提问by Blaxkies
How can I preview an HTML file on Google Drive? I did a bit of research and it seems hosting HTML has been deprecated by Google in 2016. I tried to open the direct link of the HTML file but it downloads it and doesn't display it. Any workaround ? Thanks :D
如何在 Google Drive 上预览 HTML 文件?我做了一些研究,似乎托管 HTML 已在 2016 年被 Google 弃用。我试图打开 HTML 文件的直接链接,但它下载了它并且没有显示它。任何解决方法?感谢:D
采纳答案by Paul Anderson
Ironically Google, a company built on html, still has no good solutions for handling .html files on Drive: I'm web developer! If you create a .html file within any text editor (Mac, Linux or MS) and save it with a .html extension (e.g. test.html), that file is now a Browser file, not a text or Doc file. G-Drive was created to be a cloud replacement for MS Office suite of products (Word, Excel, and so forth). It will even save a .txt (or text) file, and display it back as such.
具有讽刺意味的是,谷歌,一家建立在 html 上的公司,仍然没有很好的解决方案来处理 Drive 上的 .html 文件:我是网络开发人员!如果您在任何文本编辑器(Mac、Linux 或 MS)中创建 .html 文件并使用 .html 扩展名(例如 test.html)保存它,该文件现在是浏览器文件,而不是文本或 Doc 文件。G-Drive 旨在成为 MS Office 产品套件(Word、Excel 等)的云替代品。它甚至会保存一个 .txt(或文本)文件,并将其显示回来。
However, a file dropped in Drive (via the Chrome browser) with a .html extension; if you simply click on it, it will be opened by/in Docs, and displayed therein as a web page (and poorly too, since it cannot connect to the styling of the .css file). If you right-click on it, and select "display", it will give a similar display only without opening it in Docs. If you right-click and select "download" it will download in .doc format. Yes, worthless! I copy the html, code and all from the file on my PC, and paste it into a blank Doc file, which is OK for a backup of that file, plus it will spell-check and all, but it is not an easy way to cloud save or sync. And, it cannot open the browser to view it, because it is internal to (or already inside of) the browser. The only accurate way to preview a .html file, is for the file to be external to a browser (any web browser), and then opened inside or with that browser.
但是,在云端硬盘中(通过 Chrome 浏览器)删除了一个扩展名为 .html 的文件;如果您只是单击它,它将由/在 Docs 中打开,并在其中显示为网页(也很糟糕,因为它无法连接到 .css 文件的样式)。如果您右键单击它并选择“显示”,它将只提供类似的显示,而无需在 Docs 中打开它。如果您右键单击并选择“下载”,它将以 .doc 格式下载。是的,一文不值!我从我的 PC 上的文件中复制 html、代码和所有内容,并将其粘贴到一个空白的 Doc 文件中,这对于该文件的备份是可以的,而且它会进行拼写检查等等,但这不是一个简单的方法到云保存或同步。而且,它无法打开浏览器来查看它,因为它在浏览器内部(或已经在浏览器内部)。预览 .html 文件的唯一准确方法,
To repeat: If you simply click on it, it will be opened by/in Docs, and displayed therein as a web page (and poorly too, since it cannot connect to the styling of the .css file). If you right-click on it, and select "display", it will give a similar display only without opening it in Docs.
重复一遍:如果您只是单击它,它将由/在 Docs 中打开,并在其中显示为网页(也很糟糕,因为它无法连接到 .css 文件的样式)。如果您右键单击它并选择“显示”,它将只提供类似的显示,而无需在 Docs 中打开它。
回答by DaImTo
I am not exactly sure what you mean by display. If you just want to preview a file in google drive open it and see its contents then the only types are
我不太确定你所说的显示是什么意思。如果您只想预览 Google Drive 中的文件,请打开它并查看其内容,那么唯一的类型是
PDF, Microsoft Office file, audio file, or photo.
PDF、Microsoft Office 文件、音频文件或照片。
Just double click your html file you can preview it in drive.
只需双击您的 html 文件,您就可以在驱动器中预览它。
please see View and open files
请参阅查看和打开文件
If you are actually talking about web hosting a html file then. Hosting of HTML files from within Google drive was Deprecating in August of 2015 and shut down completely in August of 2016 so you can no longer host HTML files directly via Google drive Please see Deprecating web hosting support in Google Drive
如果您实际上是在谈论托管 html 文件的网络,那么。从 Google Drive 内托管 HTML 文件已于 2015 年 8 月弃用,并于 2016 年 8 月完全关闭,因此您无法再通过 Google Drive 直接托管 HTML 文件请参阅弃用 Google Drive 中的网络托管支持
Alternative would be to use Google Domainsto host a site that way this option is not free as far as I know.
另一种方法是使用Google Domains托管一个网站,据我所知,此选项不是免费的。