How to edit HTML in Google Drive? - html

I have hosted a HTML file created on my PC (along with a stylesheet) on Google Drive using the script described here.
I have given out the link and it seems to be working fine (no reported issues from those I've sent it to).
I have just discovered a minor omission from the file, I need to add another sentence. This should be ridiculously easy on a PC, I could just open it on notepad!
I can't find a way to edit it on Google Drive, the only connected apps are the viewer and Docs.
The viewer, as the name suggests, will only let me view the HTML, and the docs app won't let me save it back to the original file.
Obviously I could download it then upload again, but from experience it will probably give me a different URL.
Is there any way for me to do this while keeping the link the same, as I have already given the address out?

Currently you can't. You can only preview html files, that is preview the code or preview the rendered content, but you cannot natively edit the code. You have two options:
use a third party extension, such as Neutron Drive or Drive Notepad.
install the Google Drive Desktop App, edit your files locally and save. Changes will be uploaded automatically.

I have just used HTML Editey chrome app

You can do this through file revisions. Hopefully, Google adds another way, but using the revision feature works for me. To revise your file, click the check mark in the Google Drive file list, click more, and then click "Manage revisions...". In the box that pops up, click upload new revision and then you're set.
You may also be able to edit html files stored in google drive through other plugins, but I do not use any at this time to know of them.

Update!
go to drive right click your html file
choose "open with" then "connect more apps"
when app library pop up search for "notepad" then choose "drivenotepad"
after it connect to drive, select it, you will get code editor.

Related

What is the internal file format of a .glink file?

I would like to add URL links into a web-based Google Drive folder. Searching online, it appears that this was once possible with files that ended in a .glink extension. I'm looking for documentation on the file format so that I can create them programmatically.
[EDIT] Why do I want to create .glink files? Because I want links (bookmarks, URLs) to be able to appear in my Google Drive web page and to be able to click on them an go to the page. Microsoft OneDrive supports this functionality.
GLINKS Files
The URL link file feature was available due to a workaround with Back Up and Sync before being deprecated with Drive for Desktop. The .glink seems to be patched and no longer available as it was also part of a third party tool no longer available. It seems it now only saves them as .URL and automatically gives it the icon for Google Docs, as it would take it as a simple file with text.
Checking the .url type file of Windows, when uploading to Drive it does not update as it should, even utilizing Drive for Desktop (as an alternative to sync data like back up and sync) the outcome is the one suggested above.
This is the main reason why there is no longer any documentation about the matter, due to this one not being an official feature and being also fully deleted, it can be confirm by the file type available when creating files with the Drive API:
https://developers.google.com/drive/api/guides/ref-export-formats
I would suggest to request a feature to allow this or to provide a new way to store URL links as before or report it to review if possible any references on how it used to work by submitting a feature request or checking the issue tracker about the matter:
https://issuetracker.google.com/issues/new?component=191650&template=824106
You can also add the details of the previous threads or discussions about the GLINKS.

How to get a direct link from Google Drive?

I know it is possible to get a link that will initiate a download of a file from Google Drive. But this is not exactly what I am looking for. I want to be able to have the link of a file with its extension.
For example, it is possible to do this with Dropbox. I am able to get a direct link if I change "www.dropbox.com" to "dl.dropboxusercontent.com". So if I have a video file, it will play on the browser's player instead of opening the page to download it.
With Google Drive I don't know how to do this. If I generate a direct link, it will then create a link that automatically starts a download. A direct link for a .txt file will not be rendered on the browser. It will be downloaded instead.
So, it is possible to have a direct link to a file in Google Drive that is not the direct link that starts downloading automatically, but instead with the directory/file.ext?
There are several things you need to understand about how the Google drive api works.
When you do a file.get with the Google Drive api it returns a file resource this is the response for the file itself. The information about it that google is willing to share with us. There are two fields here you may find interesting
The first thing you should know is that a file has one or the other of these links not both. If the file is a binary type for example an image you will be given a webContentLink which can be used to download the file, If its say a google sheet then you will be given a webViewLink which can be used to view the file in Google Drive web application.
Which link you get depends entirely upon the type of file it is. No matter which link you get you will still need to have permission to access this file. So whoever clicks the link must have at the very least read permission to the file.
On the Google drive web application we can create links which can be shared with anyone and allow anyone to "access" there is no way to create these links VIA the api.
What you wish to do is out of scope for the Google drive api, probably due to security reasons. Also the simple fact that google drive api is not a file service api it a file storage system. THere is a difference.

File Monitoring and Upload via Google Chrome Extension

I am trying to build a Google Chrome Extension which does the following -
1) Gets activated when someone visits my site say http://example.com
2) When someone downloads a file from my site , http://example.com, it starts monitoring that file for changes.
3) If the user edits and saves that file, it uploads the modified file back to the system.
My site is a niche document management system for a particular industry. Users dont want to downloads files, edit and then re-upload again. They want the files to be uploaded as soon as they save on their side. Its mostly for .docx, .xlsx files.
I tried to look at the Google chrome apis, but couldnt locate the appropriate ones. Any help would be useful.
Thanks!
As per your description, I believe chrome.downloads is what you want.
Use the chrome.downloads API to programmatically initiate, monitor, manipulate, and search for downloads.
To monitor, you could listen to chrome.downloads.onCreated and chrome.downloads.onChanged

Provide preview for custom files in Google Drive

I've developed a Google Drive app called VideoNot.es (http://videonot.es).
When users try to open files directly from Drive, without installing the Chrome app, it shows up an overlay saying "No preview". In consequence, they don't really understand how to open it with my app and I have to explain that they need to go to Manage Apps and make VideoNot.es the default app for this kind of files.
How can I improve this flow?
Thanks for your help!
Provide a file thumbnail, it should appear on the file preview if Google Drive can't render a thumbnail itself. Details are on https://developers.google.com/drive/file at the "Uploading thumbnails" section.

ChromeOS App: Simple example app which opens/saves to Google Drive as well as Download and External Drive

I've succeeded in using the filesystem API in a Chrome App on my Chromebook. But none of the examples I've found allow you to open files from Google Drive. Any number of apps on the Chromebook (supplied or added) open the exact same dialog but with Google Drive showing on the left along with Download and External Drive.
Is there a simple example App which shows how this is done?
Or am I simply missing some concept which will make even the Diff or TextEdit examples work this way if done (like pushing the App to the store, perhaps -- right now I'm just loading and packing my own off local storage)?
From reading your comment it seems that you will want to use google drive sdk in order to integrate the 'open file' dialog into your web app.
and even more to the point - the file 'picker' - In order to integrate the file picker you will need to use google JS client lib. Then you will be able to open the file dialog with a code like this:
// Use the Google Loader script to load the google.picker script.
google.setOnLoadCallback(createPicker);
google.load('picker', '1');
// Create and render a Picker object for searching images.
function createPicker() {
var picker = new google.picker.PickerBuilder().
addView(google.picker.ViewId.IMAGE_SEARCH).
setCallback(pickerCallback).
build();
picker.setVisible(true);
}
Good luck.
The answer to this is to use the <input type="file" name="somename" size="chars"> code in the browser. That is what is producing this. It creates a standard way to read in the file from disk or Google drive. It's what I've seen in multiple apps. All the API stuff is a red herring, if what one wants is to get access to this simple dialog.
However, it doesn't allow me to WRITE, just to read, since one would expect it to be returning only the content of the file, not a file handle of any sort, or even the full name. I'll play with it and figure out whether there's any hook I can find to tell me to write it to Google drive (using the links Ido provided above). If anyone has suggestions on where to snag the full path (or an interesting Google Drive path) somewhere using this, I'll love to hear them.