NEWBIE question - Open Files

349 views
Skip to first unread message

ung...@gmail.com

unread,
Jul 28, 2014, 8:16:12 PM7/28/14
to tiddl...@googlegroups.com
How do I open files (stored on my HD or elsewhere) from TW?  How do I open a pdf file?  These to me are very basic questions that have eluded me for days.  I assume I will need to supply a link somehow to a program to open the file unless it can be opened in a separate FF window.  Is it better if I have these files included in the directory or a subdirectory of the one where my TiddlyWiki.html is stored?  (Long term they could reside anywhere I suppose.)

.

Richard Smith

unread,
Jul 28, 2014, 8:51:04 PM7/28/14
to tiddl...@googlegroups.com
Hi there,

The easiest way I have found to display an external pdf is to include it in an iframe

<iframe src="pathtoyourpdf.pdf"></iframe>

You can also have it open in a separate window if you prefer, upon clicking a link

<a href="pathtoyourpdf.pdf" target="blank">Your Link Text</a>

The program that your machine actually uses to open the file is an operating system setting.

Bear in mind that if the location of the file changes, you may need to update the references to it and so, depending on the nature of the documents, it may be better to upload it (eg; to dropbox) and then link to that copy, which will work from anywhere.

Does this help?

Regards,
Richard

ung...@gmail.com

unread,
Jul 29, 2014, 9:00:29 PM7/29/14
to tiddl...@googlegroups.com
Posted a long response but Google Groups ate it.

Are you two suggestions HTML code?
Don't know what an iframe is?
What is purpose of target "blank"
Second solution opened a new FF tab and not another separate window and FF could not open the pdf.

Firefox doesn't know how to open this address, because one of the following protocols (c) isn't associated with any program or is not allowed in this context.

    You might need to install other software to open this address.

Richard Smith

unread,
Jul 29, 2014, 11:33:37 PM7/29/14
to tiddl...@googlegroups.com

Are you two suggestions HTML code?

Yes. Tiddlywiki understands some HTML.
 
Don't know what an iframe is?

An iframe is a way of showing one webpage inside another - as if through a little window.
 
What is purpose of target "blank"

That bit makes the link open in a new window/tab (usually tab). If you're interested in the syntax of links, you can read about it here - http://www.w3schools.com/html/html_links.asp - it's usually pretty easy to figure out other bits of html when you need them too without being too complicated, for example inserting images or tables - it's all quite easy (I'm certainly no expert).
 
Second solution opened a new FF tab and not another separate window and FF could not open the pdf.

Firefox doesn't know how to open this address, because one of the following protocols (c) isn't associated with any program or is not allowed in this context.

    You might need to install other software to open this address.

hmmm... are you using an old version of firefox or on a corporate network? Firefox is supposed to be able to open pdf's by default now. There is some more information here, with some alternative solutions.



Regards,
Richard

Daniel Baird

unread,
Jul 30, 2014, 1:36:39 AM7/30/14
to tiddlywiki

On 30 July 2014 13:33, Richard Smith <richardwil...@gmail.com> wrote:
[...]

Firefox doesn't know how to open this address, because one of the following protocols (c) isn't associated with any program or is not allowed in this context.

    You might need to install other software to open this address.

hmmm... are you using an old version of firefox or on a corporate network? Firefox is supposed to be able to open pdf's by default now. There is some more information here, with some alternative solutions.


the bit about "...one of the following protocols (c) isn't associated..." makes it sound like you've used a Windows style file path to say where the PDF file is, starting with the drive letter, like C:\whatever.

In a web browser you can't use paths like that, you need something more like:
file:///C|/My Documents/ALetter.html
yes that's triple slashes, and a pipe character | instead of a colon : .


Cheers
Daniel


--
Daniel Baird
objoke: I had a problem and decided to solve it with threading. Now, have problems. two I

ung...@gmail.com

unread,
Jul 30, 2014, 5:14:00 AM7/30/14
to tiddl...@googlegroups.com
What I used was:

<a href="c:\users\richard\documents\mytiddly\stlukeconcertseries.pdf" target="blank">Your Link Text</a>

This did not open a new window.  This opened a new tab.  This did not open the file.

So I may have another problem with the file name also.  I can try Daniel Baird's direction.

ung...@gmail.com

unread,
Jul 30, 2014, 5:12:59 PM7/30/14
to tiddl...@googlegroups.com
More input/thoughts - on another WIKI I use (which I am hoping to move to TWC) files are located on a server but have a URL.  When I click on the links to these files from within the WIKI, i am given three choices - open, save, or cancel.  The open option opens the file in a separate window ans uses the appropriate program for the file type/extension.  Save option puts the file in any location to which I have access.  Am I asking too much of TWC to do something similar?  The files I wish to store and open and link to need to be uploaded to the server and are given a URL by the software. Should I be looking for a way to store the files that assigns a URL.

Rich

Richard Smith

unread,
Jul 30, 2014, 10:41:41 PM7/30/14
to tiddl...@googlegroups.com
If the files have a url it's easy to link to them. When I make a google-drive or dropbox file public, I get a url like "https://dl.dropboxusercontent.com/u/83055414/booktemplate.html"

I can make a TW link to it like this:

<a href="https://dl.dropboxusercontent.com/u/83055414/booktemplate.html" target="blank">My Link</a>

If I click the link, the document opens in a new window. If I want to save it, I right-click the link and choose "save-as". You can also open it in a new window from the same dropdown.

Regards,
Richard

Jeremy Ruston

unread,
Jul 31, 2014, 3:15:32 AM7/31/14
to TiddlyWiki
On Thu, Jul 31, 2014 at 3:41 AM, Richard Smith <richardwil...@gmail.com> wrote:
If the files have a url it's easy to link to them. When I make a google-drive or dropbox file public, I get a url like "https://dl.dropboxusercontent.com/u/83055414/booktemplate.html"

I can make a TW link to it like this:



You should also be able to use this syntax:


Best wishes

Jeremy

 

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
For more options, visit https://groups.google.com/d/optout.



--
Jeremy Ruston
mailto:jeremy...@gmail.com

ung...@gmail.com

unread,
Jul 31, 2014, 7:02:33 PM7/31/14
to tiddl...@googlegroups.com, jeremy...@gmail.com
I appreciate all the advice - possibly what I am envisioning is not possible and that leads to a 2nd question - let me try the 1st question one more time - can I link to a file via TWC and have it open in a separate window?  I don't think this is possible.  If I wanted to link to a *.doc WORD document, and have the link open the doc in MSWORD, a separate window, can I do this?  I think I am being told no.  Some files - such as pdf - can be opened in an iframe or even a second tab (in FF at least) but the browser needs to have the capability to process the file type.  Is that correct?  I think I can link to other html files and have them open as a tiddler or even in a different FF frame.  But if the browser cannot process the file type, not html or pdf, I cannot link to the file and have it open? 

My 2nd question is in here somewhere. In the current wiki I use  (NOT TWC) I can link to an excel spreadsheet with a link such as http://libraries.xx.com/download? fileid=204568254101&entity_id=865987210&sid=101.  The spreadsheet was previously uploaded to the library and the software there apparently gave it this url.  Protocol is Hyper Text Transfer Protocol and type is COM/DOWNLOAD File.  So the second question is basically can I create such a library and store files to which I link in a form so that they can be opened in a window driven by the exe that can open the file?  And can I do this on my local PC?

Richard Smith

unread,
Jul 31, 2014, 8:49:22 PM7/31/14
to tiddl...@googlegroups.com
I appreciate all the advice - possibly what I am envisioning is not possible and that leads to a 2nd question - let me try the 1st question one more time - can I link to a file via TWC and have it open in a separate window?  I don't think this is possible.  If I wanted to link to a *.doc WORD document, and have the link open the doc in MSWORD, a separate window, can I do this? 

Opening in a "separate window" would usually mean a separate browser window. This usually doesn't happen in modern browsers because everybody hated it, but maybe you can turn it back on. If you create a link to a *.doc file and then click it, it's your browser that decides what to do. If it's set to launch 'word' then that's what should happen.

I think I am being told no.  Some files - such as pdf - can be opened in an iframe or even a second tab (in FF at least) but the browser needs to have the capability to process the file type.  Is that correct?  I think I can link to other html files and have them open as a tiddler or even in a different FF frame.  But if the browser cannot process the file type, not html or pdf, I cannot link to the file and have it open? 

Your browser should know what to do with most file types. If you have successfully accessed similar documents on other sites, then it does.
 

My 2nd question is in here somewhere. In the current wiki I use  (NOT TWC) I can link to an excel spreadsheet with a link such as http://libraries.xx.com/download? fileid=204568254101&entity_id=865987210&sid=101.  The spreadsheet was previously uploaded to the library and the software there apparently gave it this url.  Protocol is Hyper Text Transfer Protocol and type is COM/DOWNLOAD File.  So the second question is basically can I create such a library and store files to which I link in a form so that they can be opened in a window driven by the exe that can open the file?  And can I do this on my local PC?

The files on your PC all have local addresses. You can refer to them absolutely or relative to the current file, but only on your PC. Did you try what Daniel Baird suggested?

If you want to access them from other places they need to be hosted somewhere. Everything that's hosted has a url. If you want to access the files on your own machine over http then you will need to run a local webserver. There is probably one built in to your operating system, or any number of other ways to do it.

Try this. Put your tiddlywiki in the same folder as one of your doc files and write a tiddler that says

<html>
<a href="./example.docx" target="blank">link</a>
</html>

(change example.docx to the name of your file)

Click the link and see what happens. For me, chrome downloads it and firefox gives me a dialogue offering to open it in a word processor. 

Is there a reason you are using TWC instead of TW5? I have found the latter to be much nicer to use.

ung...@gmail.com

unread,
Aug 2, 2014, 9:02:12 AM8/2/14
to tiddl...@googlegroups.com
Success at last.

Separate window means separate Window as in Microsoft Windows.  A browser window is a type of window, but not what I wanted.  For example, what I am able to do now is have a TWC link suggest software to open a file (such as xlxs) and it opens in an Excel window.  A linked pdf file is opened in a separate tab using browser software/add-in.  If I need the full set of Acrobat tools I can download the pdf and operate on it that way.  This is good.

I did not try Daniel Baird's suggestion - was trying to follow your intial suggestion - <a href="pathtoyourpdf.pdf" target="blank">Your Link Text</a>

I followed your last example - <a href="./example.docx" target="blank">link</a> - after having co-located the Tiddler and the file and that worked.  I think I understand now that the path is constructed differently from Windows method - c:\ etc. - so I think that finally connected in my head.  But have not been able to make an "absolute" reference work after trying Baird's suggestion.

I chose TWC having been scared off by the "beta" designation and believing learning would be easier on a more stable (slower rate of change) software and with more users to help me.  I did use TW a little several years ago but only as a home page and a place to store links - before I switched to IGOOGLE (now defunct).

I now want to explore local webservers, link with files not in the same directory, and why I should make a jump to TW5.

Thank you all for your patience and assistance.

ung...@gmail.com

unread,
Aug 3, 2014, 7:45:50 AM8/3/14
to tiddl...@googlegroups.com
I am now able to link to files using absolute location/reference/path.  It appears there may be more than one way, bbut what worked for me was:

<html>
<a href="///C|/Users/Richard/Desktop/guess3.png"target="blank"> cousins</a>
<html>


Perhaps it will become second nature, but getting the "/" and the "." and the "|" in the correct place was my problem.  The png file opened in FF; how to get it to open with some other software I can save until later.

Rich

Daniel Baird

unread,
Aug 3, 2014, 7:45:15 PM8/3/14
to tiddlywiki

If you use the "open file" menu option of your browser, then navigate to the file you want and open it, you might be able to just copy the path from the URL bar (and all the //// and | etc will be correct).

ung...@gmail.com

unread,
Aug 4, 2014, 6:18:29 PM8/4/14
to tiddl...@googlegroups.com
Sorry for being so thick:

This works for me.

<html>
<a href="///C|/Users/Richard/Desktop/guess3.png"target="blank"> cousins</a>
<html>


but what do I do with

file:///C:/Users/Richard/Videos/OPEN%20HOUSE%20R2P1.mp4


or

file:///K:/DCIM/100MEDIA/IMAG0379.jpg

which has the word "file:", another colon and no pipe, etc?


Rich

Daniel Baird

unread,
Aug 4, 2014, 7:05:32 PM8/4/14
to tiddlywiki

The bit at the start of a URL, before the first colon, is called the protocol.  "file://" is just like "http://" or "ftp://", it tells the browser how to go about getting the thing.  However browsers try to make your life easier and often let you leave stuff like the protocol off.  That's why you can type "google.com" and your browser guesses you mean http://google.com.

Anyway my Firefox on OSX wants the "file:" in front of a path to a local file (but OSX doesn't have drive letters, so it's quite different after that).  If you're on windows maybe you don't need the "file:" prefix, or maybe some browsers will need it and some won't... bottom line though, if what you have is working, don't worry about the "file:" bit.

Cheers
Daniel

Un Gozo

unread,
Aug 4, 2014, 8:36:16 PM8/4/14
to tiddl...@googlegroups.com
I got this to work:

<a href="file:///C:/Users/Richard/Videos/OPEN%20HOUSE%20R1.mp4" target= "blank">video2</a>

Is this what you meant?

I am not sure why there is no pipe and there is a colon or two, so it seems somewhat arbitrary as to what works and doesn't.

TWC on FF 
You received this message because you are subscribed to a topic in the Google Groups "TiddlyWiki" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tiddlywiki/f9tg6FlHVpg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tiddlywiki+...@googlegroups.com.

Daniel Baird

unread,
Aug 4, 2014, 8:54:22 PM8/4/14
to tiddlywiki
On 5 August 2014 10:36, Un Gozo <ung...@gmail.com> wrote:
I got this to work:

<a href="file:///C:/Users/Richard/Videos/OPEN%20HOUSE%20R1.mp4" target= "blank">video2</a>

Is this what you meant?

I am not sure why there is no pipe and there is a colon or two, so it seems somewhat arbitrary as to what works and doesn't.


You have it exactly -- "somewhat arbitrary" is precisely what it is, and you should just do the thing that works.  :)

A friend of mine noticed that there was no current standards document describing how the file:// protocol was supposed to work, and proposed making one.  Other standards people basically told him that it would be impossible to describe current practice, so don't even try.  I think he did try for a while anyway, but eventually he ran out of steam :)


Cheers
;Daniel

--
Daniel Baird
objoke: I had a problem and decided to solve it with threading. two Now, problems. have I

Matabele

unread,
Aug 5, 2014, 2:12:39 AM8/5/14
to tiddl...@googlegroups.com
Hi

The current state of affairs with respect file URI's is fairly well outlined here: https://en.wikipedia.org/wiki/File_URI_scheme

This works for me in TW5 with this syntax:

[ext[pretty link text|file URI]]

The preceding "file://" is often superfluous; I am, therefore, able to use links such as this (in linux):

[ext[Bambandyanalo|/media/files/Document Library/bambandyanalo.pdf]]

-- for a file in the same directory as the TW:

[ext[Bambandyanalo|./bambandyanalo.pdf]]

The browser behaviour when clicking these links may be changed in the browser settings -- the file may be saved / opened with a specified application / or even viewed in a browser tab with a suitable plugin (PDF Viewer in the case of pdf's.)

regards

Daniel Baird

unread,
Aug 5, 2014, 7:58:39 PM8/5/14
to tiddlywiki

On 5 August 2014 10:54, Daniel Baird <danie...@gmail.com> wrote:


[...]

A friend of mine noticed that there was no current standards document describing how the file:// protocol was supposed to work, and proposed making one.  Other standards people basically told him that it would be impossible to describe current practice, so don't even try.  I think he did try for a while anyway, but eventually he ran out of steam :)



A bit off topic, but for curiosity's sake: here's Saint Matty's post about his efforts, written late last year.  The last commit to his github repo was 5 months ago :|


--
Daniel Baird
Reply all
Reply to author
Forward
0 new messages