XUpload - forcing lowercase

Message
Author
ibiz
Posts: 6
Joined: Sep 16, 2007 3:14 am

forcing lowercase

#1 Postby ibiz » Sep 24, 2007 5:37 pm

Is it possible to force file uploads to lowercase?

e.g. 3800a.JPG should be 3800a.jpg

This is important because our web page templates already have the .jpg extension in the placeholders. When a member uploads it with uppercase extensions, it will not appear properly on their page.

I understand this is no fault of the Xupload, but it would be great if this can be accomplished with the script.

Thank you.

Jim

User avatar
PilgrimX182
Posts: 2186
Joined: Mar 22, 2006 1:39 pm

#2 Postby PilgrimX182 » Sep 25, 2007 6:56 am

In upload.cgi find line

Code: Select all

$filename=~s/^.*\\([^\\]*)$/$1/;
and add below

Code: Select all

$filename=lc($filename);

ibiz
Posts: 6
Joined: Sep 16, 2007 3:14 am

#3 Postby ibiz » Sep 25, 2007 4:48 pm

This worked great. Thank you very much.

Jim