23

I have made a guide (or something like a tutorial) about my tool to share with my company. I used Google Docs to do that, and I would like to add links to open video guides. I want to know a way to add link in the document.

beaver
  • 523
  • 1
  • 9
  • 20
Hyun-geun Kim
  • 919
  • 3
  • 22
  • 37
  • I wonder if there is a way using a "user script" (cf. Tampermonkey). – JinSnow Oct 21 '19 at 05:55
  • 1
    This has nothing to do with Google docs.. Hence answers given here are the same as if you had asked how do you , within an Ms Word document, add a link to a local file. Which is also nothing to do even with Ms Word. It's simply asking how to add a link to a local file. Links are normally in webpages though other platforms can support them. After that, one can say, I see that google docs doesn't support `file:///c|/carp/a.txt` or `file:///c:/carp/a.txt` but u can always do http://127.0.0.1/a.txt youd have to set up a web server. Nothin to do with gdocs. Same applies from any webpage. – barlop Dec 25 '20 at 17:20

4 Answers4

11

What I do is the following. Links in sheets ( or in your case Docs) only respond to internet protocols e.g. HTTP://, HTTPS:// and so on... . It does not respond to file explorer protocols (like excel or word does) e.g. file:\\ or C:\.

So I installed WampServer (any other server will do as well, I just use this) and then copied the files into the WWW folder.

Now you can link to files that way. Google Docs/Sheets accept links to localhost as acceptable files to establish a link.

Be aware, your server will have to be online for the links to work. But this is how I solved my problem without uploading items to the cloud that I want to keep private and still use in google docs.

This is just for my local computer, if you want to share the doc with others in a local environment a little more understanding of your local server operations will be needed (i.e. do not use localhost, but refer to your IP-address).

The server can be scale-able on your local network as well, at this point a little more education will be required.

However, if you want to share the doc with others around the world this will not work at all

g00glen00b
  • 41,995
  • 13
  • 95
  • 133
Hudson
  • 111
  • 1
  • 2
  • The node-based [http-server](https://www.npmjs.com/package/http-server) is a fine server. Install it globally `npm install http-server -g`, then open a terminal window in the folder with the files and run `http-server`. Files are accessible at http://localhost:8080/path/to/file.jpg – Motin Dec 08 '17 at 18:27
  • can do `python -m http.server 8080` and access `127.0.0.1:8080` but anyhow, I don't think google docs would be able to write to the document so it's fairly limiting. And where is google doc's option to open a URL anyway? btw http://127.0.0.1:8080/sdfs.docx doesn't open it it just leads chrome to download it – barlop Nov 22 '20 at 01:33
  • @barlop (and others) see [my answer] to your follow-up question [How do you access local documents via HTTP from Google docs, assuming you have a web server set up?](https://stackoverflow.com/q/64950026/1595451) – Rubén Nov 22 '20 at 02:50
6

What I do is upload the files on Google Drive, and post the shareable link on Google Doc. Works like a charm!

Anshul Sharma
  • 69
  • 1
  • 1
  • 1
    The question was about adding a link to a local file. If you've uploaded the files to the cloud, they're no longer local files. Ugh, cloud everything. – localhost Oct 24 '22 at 22:16
  • I was considering local links to my images but this idea might be better for me since then all the images are together. – Scott Dec 28 '22 at 14:33
4

Try Redirector. It's simple Chrome/Firefox add-on for redirections. You can add before your path "http://" - Google Doc will be OK with that, then just configure redirection rule in addon. Rule can include wildcard or regular expression.

Lukaszy
  • 191
  • 17
  • 1
    I'm trying and it works with http links BUT NOT with C:\Users\ paths or file:///C:/Users paths .. what do I do wrong? – John Galassi Feb 14 '21 at 18:10
  • @Lukaszy — I've tried this, but I can't make it work. Could you please include an example? – Paddy Landau Jun 17 '21 at 14:20
  • The following redirector rule seems to be working for me: Example URL --> http://C:\temp\foo\bar Include pattern: --> (http:\/\/C:\\)(.*) Redirect to: --> file:///C:$2 Pattern type: Regular Expression also this is a great site I have used for years for testing regex, https://regexr.com/ full credit to gskinner :> https://gskinner.com/ – Derek Ewing Feb 12 '22 at 18:13
  • Would that force the browser (Edge) to "download" (copy) the local file into the Downloads folder, creating an extra copy of the file, which you have to click on in the Downloads folder to open? Is there any way to just open the local file immediately after clicking on the link? Thanks. – Vincent Phillips Oct 24 '22 at 22:09
0

For future readers - You could try linkyourfile.com (I am the developer of it)

It is a windows and mac extension for explorer and finder with which you can create an https link to a local or network file / folder. If you click on the link the extension will launch the file or the explorer / finder.

It also has some other useful features:

  • Cloud provider placeholders to fix the problem with e.g. different dropbox locations on different devices.
  • If a file / folder can not be found you can relink it and on the next link click it will be auto detected again.