SID-02329: Link to Filesystem
| Status: |
Answered |
TWiki version: |
6.0.0 |
Perl version: |
v5.10.0 |
| Category: |
CategoryMissingFunctionality |
Server OS: |
Suse Linux Enterprise Server 11 SP1 |
Last update: |
8 years ago |
Am I able to put a link to a file in my filesystem and show the content in a topic?
i.e.
file:///Z:\H14_Projekte\Infra\ARTE\1_Arbeit\Obenauer\Screenshots\AmpelGRÜN.jpg
This line - copied in a browser - opens the jpg
--
Peter Starek - 2017-09-05
Discussion and Answer
Short answer: TWiki does not autoconvert File URLs to image links, but You can try like this:
<img src="file:///Z:/H14_Projekte/Infra/ARTE/1_Arbeit/Obenauer/Screenshots/AmpelGRÜN.jpg" />
Long answer: File URLs have their problems, and a clarification of their not very convincing standardisation in the ancient
RFC:1738
didn't come up until this year in
RFC:8089
. The quirks are:
- Unlike HTTP URLs, File URLs have no defined "access protocol", so browsers only know how to open files on your local drives. However, other people visiting the same web page may not have the same image in the same place.
- The TWiki way to do it would be to attach the image to a topic, and then refer to this attachment, so that everyone gets the same picture.
- Unlike HTTP URLs, local files do not provide information about their MIME type, so browsers guess from the extension or from peeking into the file. For text files (not relevant for your question), local files may also lack information about their encoding.
- In your path, there's a character which has a different representation in different encodings. You'll need some guesswork to get a consistent encoding between your file system and your web page / TWiki configuration, or stick to ASCII file names.
--
Harald Jörg - 2017-09-05
Thank you for the answer. Unfortunately the <img src...> does not work. But in the long answer it is explained, so the ticket can be closed.
--
Peter Starek - 2017-09-06
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.