00315: allow upper-case file extensions in attachments (Closed - added for 2.0.beta28)

Summary: allow upper-case file extensions in attachments
Created: 2005-02-02 16:55
Status: Closed - added for 2.0.beta28
Category: Feature
From: Pm
Priority: 4
Version: 2.0.beta20

Description: Attachments should allow and recognize uppercase file extensions.

Question: Should PmWiki convert uppercase file extensions to lowercase, or simply leave them "as-is"?

Could it be a checkbox, like

 [*] Convert the file's extension to lower case

so people can decide when they are uploading? Converting to lower case makes more sense to me because it would help avoid unintentional uploading of multiple versions of the same file. -Hagan

Speaking from an environment where uppercasing is commonly used in filenames and extensions by students in their media files (Georgia Tech) it would make pmwiki much more attractive to them (this is the reason we stopped using DokuWiki--as it must convert uppercasing in names and extensions). -Mark

I don't see any point for wanting upload file extensions to be case sensitive ? Forcing it systematically to lower case would avoid a quite frequent mistake and make things easier for the average user by taking care of it for him. On my implementation, I force the extension to lower case by inserting a line in MakeUploadName():

 $x = preg_replace("/([^.]+)$/e", "''.strtolower('\\1').''", $x);


I believe enforcing lower case attachments (by automatic conversion, not by rejection of non-compliant upload attempts) would be perfectly in line with the PmWikiPhilosophy of keeping things simple for naive authors.

(I don't see any functional gain from upper case extensions at all. Could be because I'm operating in a case-insensitive environment, I admit.)

--Henning March 17, 2005, at 11:21 AM

This is what the Minimage module do, it allows upper or mixed case in attachment extension text writing, but always store in lower case on the harddrive. PRZ

2.0.beta28 now forces extensions to lowercase.


This now creates a problem for attachment links to files with capitalized extensions that were ftp-uploaded. For example, if you upload a picture (foo.JPG) via ftp to your uploads folder, then link it with the code [[Attach:foo.JPG|Attach:foo.JPG]], the link will not process. It will just give the output of a yet-to-be uploaded file (i.e. Attach:foo.JPG Δ Δ). I assume this is because pmwiki does not recognize foo.JPG as an uploaded file. I view this as a significant problem because ftp uploading is a common task for picture gallery recipes. Specific instructions have to be given that all files uploaded via ftp must have lowercase extensions. I don't know how to fix this problem without creating the problems yall listed above. I just thought I should document it. A workaround might be to enable multiple image uploads via the web interface. The main reason people maintaining image galleries use ftp is that they don't have to upload one file at a time. If they were able to select multiple files to upload, it might discourage ftp-uploading.