Display an HTML file on Google Drive? - html

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

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.
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.
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.

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
PDF, Microsoft Office file, audio file, or photo.
Just double click your html file you can preview it in drive.
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
Alternative would be to use Google Domains to host a site that way this option is not free as far as I know.

Related

How to host static html page on SharePoint online

We have a simple HTML page with some embedded JS. We used to host the pages with the .aspx extension on the on-premises SharePoint where you can click on the file and it opens like a regular page. When doing so on an online version of SharePoint it turns out that instead of opening a page it downloads it. I tried to use SharePoint designer to point it to the page but no luck, also I tried to embed the page with the embedded plugin on SharePoint but it is very limited in usage (no scripts, no header with the stylesheet, etc).
So the question is how to make an online version of SharePoint to open HTML files as a regular HTML and display its content instead of downloading the pages?
We've found the odd behavior of SharePoint in conjunction with OneDrive.
It turns out that when you upload your HTML files (with changed extension to .aspx) into someone's shared OneDrive or SharePoint folder directly - it will just download the pages.
But if you first upload your files into your own OneDrive and then copy/move the content to the shared folder or SharePoint's folder - it starts to open the page as it would behave in the on-premises version of SharePoint.
So the solution is to upload files directly into your own OneDrive and then copy/move the files to SharePoint's folder.

HTML <a> tag - download attribute not producing download of pdf on chrome

I'm trying to the get a hyperlink to produce a download of a .pdf file when clicked, but instead the pdf is opened directly in the browser.
I've tried moving the pdf from the root folder (that shared with the index) to a subfolder to no avail. I've found other examples of this problem on this site where they seemed to have mis-entered the attribute, but I can't see where I made my mistake if I did.
Download factfile (pdf, 4mb) which contains lots more information, including an FAQ.</p>
It is because Google Chrome is automatically set to open pdf automatically rather than download.
To fix this issue go to 3 dots Options > Privacy & Security > Site Settings > Additional Content Settings > PDF Documents. There you will find "Download PDF files instead of automatically opening them in Chrome". Click on the button ( I don't know what it is in english sorry ) and you will fix the issue.

How to provide a download link for a dxf inside a chm

I have HTML code that compiles into a chm, and occasionally I want to include a link to directly download a file... for example a small binary drawing file (extension .qid in my app) used as sample data for a tutorial in the chm. I have been doing this just fine for little drawing files by just providing a link like this...
some text
But my current problem is I have a little sample dxf that is to be used in this tutorial and when I provide a download link like this...
some text
...then I get a link ok, but when I click on it, it puts the dxf contents inline as text, rather than poppping up a download Save As dialog for some file at a path like mk:#MSITStore:wherever.dxf
Now I looked at HTML attribute doco and found a 'download' attribute which is meant to force the link to download, but it made no difference. I used this syntax...
<a href="relativepath/some.dxf" title="whatever" download>some text</a>
...which generated a chm with a link but ignored the attribute 'download'.
How can I force the href link to lead to a download dialog for a dxf file?
Please note CHM's are 20 years old. hh.exe is the HTMLHelp executable on Windows and associated with *.CHM files. It's just a shell that uses the HTML Help API and is really just hosting a browser window based on the old Internet Explorer in the HTMLHelp Viewer window. This is not based on Microsoft's browser EDGE!
You know, the HTML (!) Attribute directs new browsers to download the linked resource rather than opening it.
But - the download attribute is not supported by Microsoft Internet Explorer.
I tested linking from a single local HTML file too. Other browsers like Firefox, Chrome and EDGE also open a link to a local *.DXF file always as text file.
This also happens with embedded (compiled into a CHM file) *.dxf files.
So, you'll need to create a link to a ZIP file like e.g. some.dxf.zipinstead.
UPDATE:
This is working when the *.DXF file is not embedded and stored on a server: Test it for your needs by using in the old manner
test.dxf download

Problems With Hosting Websites With Google Drive

I am currently making a website that I am hosting with Google Drive. I finished coding the login GUI of my website and I went to go test it. The html file is in a public folder. I got the document id of the folder and went to the URL that hosts my webpage. But it doesn't render my html. Instead, Google just displays my code. How do I fix this?
Click here to link to my webpage
Okay, so I looked at the properties of my file on Google Drive. It said that the file type was plain text. I downloaded the file and then uploaded it again as an html file. I got the document ID and tried again. This worked. The problem was that Google saw a plain text document so that's what it rendered. I just needed to change the file type of the file. I solved my problem although I cannot logically make sense of why my file downloaded as an html file if on Google Drive it was a plain text format.

opening html from google drive

I have made a page in html5 with css3. It works fine on local (I dont use any server, just doubleclick in the index to open it).
I want to put it in google drive. I have load all the documents needed, but when I try to open the html, I can only see the text (I mean, it is not being executing, I can see just the source code).
Any suggestion?
Not available any more, https://support.google.com/drive/answer/2881970?hl=en
Host web pages with Google Drive
Note: This feature will not be available after August 31, 2016.
I highly recommend https://www.heroku.com/ and https://www.netlify.com/
EDIT: As of August 2016 Google Drive can no longer be used to host static web pages, so this solution no longer works.
Create a new folder in Drive and share it as "Public on the web."
Upload your content files to this folder.
Right click on your folder and click on Details.
Copy Hosting URL and paste it on your browser.(e.g. https://googledrive.com/host/0B716ywBKT84AcHZfMWgtNk5aeXM)
It will launch index.html if it exist in your folder other wise list all files in your folder.
I don't think it is necessary to "host" the content using the way from the accepted answer. It is too complicated for a normal user with limited developing skills.
Google actually has provided hosting feature without using Drive SDK/API, what you need is just few clicks. Check this out:
http://support.google.com/drive/bin/answer.py?hl=en&answer=2881970
It is the same to the answer of user1557669. However, in step 4, the URL is not correct, it is like:
https://drive.google.com/#folders/...
To get the correct host URL. Right click on the html file (you have to finish 1-3 steps first and put the html in the public shared folder), and select "Details" from the context menu. You will find the hosting URL right close to the bottom of the details panel. It should look like:
https://googledrive.com/host/.../abc.html
Then you can share the link to anyone. Happy sharing.
Now you can use
https://sites.google.com
Build internal project hubs, team sites, public-facing websites, and moreā€”all without designer, programmer, or IT help. With the new Google Sites, building websites is easy. Just drag content where you need it.
While drive allows you to edit plain text and HTML files I don't believe they allow the HTML to actually be displayed. I don't think they want people hosting websites from their drive space.
A lot of the solutions offered here do not seem to work anymore. I'm currently on a chromebook and wanted to view an HTML5 banner. This seems impossible now through Google Drive or other apps (as mentioned in previous comments).
The method I ended up using to view the HTML5 was the following:
Open Google Adwords (create a free account if you dont have one)
Click on Ads in the top panel
Click on "+AD" and choose image ad
Choose "upload an ad"
Drag and drop your zip file into the area
Click on Preview
Voila, you will see your HTML5 banners in their full beauty
There may well an easier way, but this way is pretty good too. Hope it helps and worked well for me.
Create a new folder in Drive and share it as "Public on the web."
Upload your HTML, JS & CSS files to this folder.
Open the HTML file & you will see "Preview" button in the toolbar.
Share the URL that looks like www.googledrive.com/host/... from the preview window and anyone can view your web page.
Found method to see your own html file (from here (scroll down to answer from prac): https://productforums.google.com/forum/#!topic/drive/YY_fou2vo0A)
-- use Get Link to get URL with id=... substring
-- put uc instead of open in URL