[pmwiki-users] links to image
Petko Yotov
5ko at 5ko.fr
Fri Jun 5 09:18:38 CDT 2015
This is normal and expected. Without the extension, PmWiki doesn't know
that this is an image file, so it simply links to it instead of
incorporating the picture in the page.
Now, if the picture has an extension, if the file is actually named
"page1.jpg" then this is your server software accepts partial file names
and serves them, so good for you. With the Apache server this is called
"content negociation", search for it to learn more.
If the uploaded file is named "page1" without extension, then again your
server software sees the file, recognizes that it is a JPEG picture and
sends the correct headers to the browsers. With Apache this is done by
the modules mod_mime or mod_mime_magic.
So, the "feature" you experience is related to the server software, not
to PmWiki, and it will probably stay for that piece of server software.
It may not work if you decide to use a different server, say NginX,
instead of Apache.
Also, if some day you have PmWiki serve the attached files, with
$EnableDirectDownload=0; for example in password-protected
pages/uploads, the feature may not work anymore as PmWiki relies on the
extension to send the correct headers, and sends the files without
extensions with text/plain headers. Some browsers might display the
picture correctly but most should either display garbage text or offer
you to save the file to your device.
Note that the intended way in PmWiki to link to a picture without
incorporating it, is this:
[[Attach:page1.jpg]]
instead of this one, incorporating the picture:
Attach:page1.jpg
Petko
On 2015-06-05 15:37, jdd wrote:
> Attach:page1
>
> without any extension, an then loading a jpg file, I get a link to the
> jpg file that works, that is the file do not display in the page, but
> if I click the link this loads the image.
>
> like in the page
>
> http://dodin.info/wiki/pmwiki.php?n=Serge.R%e9sum%e9DeLhistoire
>
> I just wanted to know if it's the normal way of work (my pmwiki is
> pretty old). It's the feature I need, so I want to know if it is to
> stay :-)
More information about the pmwiki-users
mailing list