_canonical_uri external pdf on node (Bob)

139 views
Skip to first unread message

Dave

unread,
Feb 25, 2019, 9:02:48 PM2/25/19
to tiddl...@googlegroups.com
Hi, 

I'm having difficulty getting an external pdf to load in a Bob instance of TW5.  I have the file both in the images folder (inside "tiddlers") and also the main tiddlers folder.

I have the field _canonical_uri  as being TW-Variables-etc.pdf or as images/TW-Variables-etc.pdf and the type set as application/pdf but the pdf "fails to load"

I've also tried the following paths, none of which work:

./images/TW-Variables-etc.pdf
../images/TW-Variables-etc.pdf
/images/TW-Variables-etc.pdf
./TW-Variables-etc.pdf
../TW-Variables-etc.pdf
/TW-Variables-etc.pdf
/home/david/SyncthingFolders/Bob/TiddlyWiki5/Wikis/BobWiki/tiddlers/images/TW-Variables-etc.pdf

this fails without any indication (just a blank tiddler):
file:///home/david/SyncthingFolders/Bob/TiddlyWiki5/Wikis/BobWiki/tiddlers/images/TW-Variables-etc.pdf


I've read conflicting accounts as to whether this should work in the Node version of TW.

Is there an obvious mistake I'm making?

or perhaps an alternative way of doing this (maybe via html markup)?


Thanks,
- Dave

Mark S.

unread,
Feb 25, 2019, 9:58:07 PM2/25/19
to TiddlyWiki

You might double check the documentation for Bob. I'm pretty sure you have to configure where your files live on the server, and maybe the virtual path that your tiddlers use.

I think node can serve up files now too, but you also have to configure the path for external resources.

You can use any directory below your TW directory for tiddlyserver. Since I'm not in an environment where I have to worry about concurrency, that works out pretty good.

-- Mark

Dave

unread,
Feb 27, 2019, 12:14:14 AM2/27/19
to TiddlyWiki
Thank you.  

You're right - there appears to be some info on this a$:/plugins/OokTech/Bob/Serving Files  I'll post here again for the record if I figure it out.

Dave

unread,
Feb 27, 2019, 12:50:43 AM2/27/19
to TiddlyWiki
I tried putting this into the settings.json file in my Bob wiki:

    "filePathRoot": {
        "filePathRoot": "/home/david/SyncthingFolders/Bob/TiddlyWiki5/Wikis/BobWiki/tiddlers/files"
    },


but to no effect.  If Jed doesn't answer the bat signal I'll try again fiddling around tomorrow ;)

LorenzGL

unread,
Feb 27, 2019, 1:41:28 AM2/27/19
to TiddlyWiki
I'm also struggling with this... despite reading the Bob documentation. For example, it is unclear to me whether I need to set a filePathRoot for serving files specific to a single wiki. The documentation states: 
  • To access these files you use the prefix /wikiName/files/, so if you have a wiki called foo and a picture called bar.jpg you would use /foo/files/bar.jpg to access it.
Hoever, when I create a toddler with _canonical_uri field set to "/foo/files/bar.jpg" I don't get the image (independent of file type, jpg or png; so this being a mime type issue is unlikely?).

Any help would be appreciated. 

Donald Coates

unread,
Feb 28, 2019, 3:09:46 AM2/28/19
to TiddlyWiki


On Wednesday, February 27, 2019 at 12:50:43 AM UTC-5, Dave wrote:
I tried putting this into the settings.json file in my Bob wiki:

    "filePathRoot": {
        "filePathRoot": "/home/david/SyncthingFolders/Bob/TiddlyWiki5/Wikis/BobWiki/tiddlers/files"
    },


check out the configuration.md for how to enter filePathRoot - it's the first line.  Finding that really solved a lot of problems for me.  Make sure you put in the pdf mimetype and be aware that if you do enter a mimetype in the settings then this becomes the mimetype list - no defaults are loaded so you have to put all you want use.

As far as linking to a pdf I found using the syntax the extended syntax worked for me. `[ext[Open file|mypdf.pdf]]`. See under External Links in Linking in WikiText.

Hope this helps.

Jed Carty

unread,
Feb 28, 2019, 3:18:14 AM2/28/19
to TiddlyWiki
Other projects have been taking up my time so I have been a bit slow at responding to things here.

I think that the file server part is one of many places where more documentation is needed.

The way it is supposed to work, and there may be bugs because I don't get much feedback about other people using it other than what is on the forums here, is that you can set the filePathRoot in the configuration. Then if you use a _canonical_url that starts with ./files/foo.jpg and there is a foo.jpg in the path listed it should appear. In addition to that, if you have a files folder inside your wiki folder and there is a file called bar.jpg there than you can use ./files/wikiName/bar.jpg to display that.

If the file can't be found or doesn't exist you get a blank tiddler, that is how tiddlywiki handles these things.

I am not sure why there is trouble with the mimemap part. There must be some bug that I haven't tracked down. When the key doesn't exist in the settings it is supposed to default to a list that contains most common media types but that doesn't seem to be the case on some computers. To be very clear "doesn't exist" means that the key is listed, not that the key is listed without a value given, that is an empty mimemap and it wouldn't let anything be served.

Hopefully this helps.

Jed Carty

unread,
Feb 28, 2019, 3:20:31 AM2/28/19
to TiddlyWiki
As a separate note, the contents of Configuration.md are also in Configuration.tid which is available under the documentation section of the Bob settings tab in the control panel.

Donald Coates

unread,
Feb 28, 2019, 11:41:26 PM2/28/19
to tiddl...@googlegroups.com

I think that the file server part is one of many places where more documentation is needed.


I feel like this is something like explaining color to a blind man.  I had a lot of trouble and then when I found the configuration file it all made sense.  Maybe just point to that in a more prominent way or more often throughout the documentation.  Anyone diving in will probably do better just seeing an example rather than reading an explanation.

And thank you Jed again.  I am really enjoying bob right now (just donated to your paypal btw).

Donald Coates

unread,
Feb 28, 2019, 11:42:40 PM2/28/19
to tiddl...@googlegroups.com
actually it is pretty well referred to I was just looking past it when I was having trouble.
Reply all
Reply to author
Forward
0 new messages