This is my best guess:

The thing to remember is that the tiddlywiki nodejs server does not serve 
any other file type but tiddlers.  If you want to serve any other file type 
you have to use another server - whether it be something like nginx or 
Bob's plugin or Arlen's tiddlyserver.

What is happening is you are asking the tiddlywiki node js server at 
localhost:8080 to serve the file with the mime type pdf / jpg - which again 
is something it cannot do.

So either you have to use one of the above solutions - and I have used both 
bob and tiddlyserver and I love them both - or right click on the file and 
select 'open in browser' and make note of what it says.  it is going to be 
something like file:///file/path/file.jpg|pdf and then that will be what 
you put in 'prefix'.  So you are essentially creating a direct link to the 
file.  It is possible as well that that file path will be browser specific 
so keep that in mind.

I hope this helps and someone with more knowledge can confirm / correct 
what I am saying.

On Monday, March 9, 2020 at 5:41:05 AM UTC-4, Mohammad wrote:
>
> Hi Donald,
> Thank you! Yes, I also use Tiddlywiki on locale machine using Node.js
> I see empty PDF tiddlers as explained by Atronoush for his image tiddlers!
> The address is always created as localhost/pdfs/filename
>
> where pdfs come from the prefix I set in tiddlywiki.files
>
> --Mohammad
>
>
> On Monday, March 9, 2020 at 11:44:17 AM UTC+3:30, Donald Coates wrote:
>>
>> Assuming you are using locally and not from a web server I would assume 
>> it is the same answer as above.  I always have to fiddle with the canonical 
>> uri prefix to get it to point in the correct direction, since the tiddler 
>> is really just a placeholder that points the browser to where the file is 
>> actually located.
>>
>> On Monday, March 9, 2020 at 2:47:16 AM UTC-4, Mohammad wrote:
>>>
>>> I tried the same example here:
>>> https://tiddlywiki.com/prerelease/#tiddlywiki.files%20Files
>>> like you I get the pdf tiddlers created but nothing is displayed!
>>>
>>> Seems something goes wrong!
>>>
>>> Hope Donald share his finding if he was successful.
>>>
>>> --Mohammad
>>>
>>> On Monday, March 9, 2020 at 9:31:35 AM UTC+3:30, Atronoush wrote:
>>>>
>>>> Hi Donald,
>>>>  I have the same problem. See my file structure where there few tens of 
>>>> .jpg pictures are loctaed in a folder (picture) in the same folder with 
>>>> mywiki (wiki)
>>>>   
>>>> -- pictures
>>>> -- myWIki
>>>> -- -- tiddlywiki.info
>>>> -- -- tiddlers
>>>> -- -- -- images
>>>> -- -- -- -- tiddlywiki.files
>>>>
>>>>
>>>> ant my tiddlywiki.files is as below
>>>>
>>>>     "directories": [
>>>>         {
>>>>             "path": "../../../pictures",
>>>>             "filesRegExp": "^.*\\.jpg$",
>>>>             "isTiddlerFile": false,
>>>>             "fields": {
>>>>                 "title": {"source": "basename-uri-decoded"},
>>>>                 "created": {"source": "created"},
>>>>                 "modified": {"source": "modified"},
>>>>                 "type": "image/jpeg",
>>>>                 "tags": ["$:/tags/AttachedFile"],
>>>>                 "text": "",
>>>>                 "_canonical_uri": {"source": "filename", "prefix": 
>>>> "pictures/"}
>>>>             }
>>>>         }
>>>>     ]
>>>> }
>>>>
>>>>
>>>>
>>>> When I start the wiki, I see all image tiddlers have been created 
>>>> successfully. but not image is shown.
>>>>
>>>> This is the structure of one image tiddler
>>>> title:IMG_20160403_172207.jpg
>>>> _canonical_uri: pictures/IMG_20160403_172207.jpg
>>>>
>>>> What do you think?
>>>>
>>>>
>>>> I appreciate to share your experience if you have been successful in 
>>>> loading several images from local disk in this way.
>>>>
>>>>
>>>>
>>>> On Monday, March 9, 2020 at 8:10:55 AM UTC+3:30, Donald Coates wrote:
>>>> Jeremy!!!!!!   That was the solution!!!!
>>>>
>>>> Sorry for the exclamations but I have dumped a lot of time obsessively 
>>>> trying to figure this out.  It has been constructive playtime I hope 
>>>> because I'm starting to get a sense of just how powerful the server can be 
>>>> beyond just serving the files, but I was beginning to despair.  I have 
>>>> been 
>>>> playing with tiddlywiki.file in other contexts and have no idea why I did 
>>>> not apply it here.
>>>>
>>>> You have truly saved my sanity.
>>>>
>>>> This was part of a more complex task I was trying to achieve which I 
>>>> will write up later in case it might help others like Beckstrom.
>>>>
>>>> Again - thank you for your advice and this wonderful tool.
>>>>
>>>> Donald
>>>>
>>>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/cd9fd7af-8c60-4a42-a7f2-949c4f77e98d%40googlegroups.com.

Reply via email to