[pmwiki-users] problem with uploaded pictures

Petko Yotov 5ko at 5ko.fr
Fri Nov 10 04:26:53 PST 2023


On 10/11/2023 13:00, Piotr Dybczyński wrote:
> after upgrading PmWiki to version 2.3.27 under Debian 11 (PHP 7.4) I
> cannot see any previously uploaded pictures nor upload new ones.
> 
> When trying to display, in Firefox I read (unfortunately in Polish):
> 
> Obraz
>https://apollo.astro.amu.edu.pl/PAD/pmwiki.php?n=Wikicomet.Oumuamua?action=download&upname=startrek_30_1b.png”
> nie może zostać wyświetlony, ponieważ zawiera błędy.
> 
> It means: the picture ... cannot be displayed because it contains 
> errors

There is a linebreak (0x0a) character before the PNG stream in this 
picture.

The most frequent reason is some of your included files (in local/ or 
cookbook/) have closing markers "?>" followed by linebreaks.

It is recommended to remove the closing PHP markers in scripts.

> When trying to upload, I see:
> 
>  Token invalid or missing.

If you're using the normal PmWiki upload form, make sure you updated 
both pmwiki.php and scripts/upload.php.

If you're using a custom upload form, you need to add the "pmtoken" 
element. In wiki code, just add within the form:

   (:input pmtoken:)

If you customised $PageUploadFmt add this inside the <form>...</form> 
space:

   <input type='hidden' name='\$TokenName' value='\$TokenValue' />

If it is a raw HTML snippet, use this:
   <input type='hidden' name='$TokenName' value='$TokenValue' />

The raw HTML snipped should be passed through FmtPageName() to populate 
the values of the variables -- it probably already is.

Petko



More information about the pmwiki-users mailing list