[pmwiki-users] Issues with non basic latin in uploads file names

kirpi at kirpi.it kirpi at kirpi.it
Thu Feb 23 10:11:55 PST 2023


> > Quite often I end up with exotic names that are stuck in my
> > folders; impossible to rename or delete them, as I get "invalid
> > attachment name" or "PmWiki can't process your request, no such
> > attachment".
>
> 'invalid attachment name' appears if you try to upload a file that
> matches the entries in $UploadBlacklist (.php, .pl, .cgi in the middle
> of a file name that may still be executed by the server.)
>
> I cannot find this message: "PmWiki can't process your request, no such
> attachment". The first part comes from the Abort() function, but I don't
> see "no such attachment".
>
> Is it "?requested file not found" ? This may come from HandleDownload()
> when a file name cannot be found.


I upload a file with a Chinese name by dragging it to the DDMU area.
Imagine it is 王毅与普京会晤_中俄关系稳如泰山_百度搜索.pdf
It uploads fine to the server but then all starts behaving weird and
the name is changed into a list of squares.
If I use Attachtable to rename it (R) a dialog appears, asking for a
new name. I enter a latin name (say dummy.pdf) and press OK.
The answer is an error page:
  PmWiki can't process your request
  ?no such attachment: �������_��������_����.pdf
  We are sorry for any inconvenience.

Now I try to delete it.
Once more go to ?action=upload page
Once more use Attachtable, now I click on the (X) link.
After a short while the page reloads with a message:
   �������_��������_����.pdf: invalid attachment name

That's it. Stuck.


> When you upload such a file, how do you link to it from the wiki?
> Do you ever type [[Attach:自由定制的风格.pdf]] in your page?
> Or do you simply have (:attachlist:) or (:thumblist:) / Mini:* that will
> list all files?

I usually drag the file to the DDMU area, wait for the link to become
green, then click on it and the Attach:file.ext is there on the page
(thanks to the work of Petko ;-)


> FileZilla has an option to change the character set. In the site
> manager, when you select a site on the left, on the right there are
> tabs, the last one is "Charset".
>
> If you cannot rename or delete files on the server because of invalid
> filenames, try changing the character set from Automatic to an 8-bit
> encoding like ISO-8859-1, then reconnect.
>
> You can do this at least temporarily in order to delete or rename the
> lost files.

Very useful.

I will make more tests and let you know.
Thank you!

Luigi



More information about the pmwiki-users mailing list