How to stop Joomla Media Manager making your image names lowercase!

I recently developed a simple module that loaded in images automatically based off a folder/file structure in the images folder. The name of the file would dictate the caption underneath the image requiring names of files to be descriptive and capitalized correctly. I didn’t realise at the time I built this module that Media Manager converts all filenames to lowercase by default. I did a quick Google and found several people asking how to switch this off but no answers.

I needed to switch this off so I did some quick searches of the admin folder and found the answer.

Open the file:
/administrator/components/com_media/controllers/file.php

If you do a search in the file for ‘strtolower’ you should find a line of code that looks like this:
(line 58 in the version of Joomla 1.5 I was working on)

$filepath = JPath::clean(COM_MEDIA_BASE.DS.$folder.DS.strtolower($file['name']));

Simply change this line to look like this:

$filepath = JPath::clean(COM_MEDIA_BASE.DS.$folder.DS.$file['name']);

And thats all there is to it. Now you can have any capitalization at all in your filenames.

DISCLAIMER: I strongly recommend not doing this as it is a core component, if you decided to do this as you have no option then at least make a note of it because next time you upgrade Joomla this change will more than likely be overridden.

9 Replies to “How to stop Joomla Media Manager making your image names lowercase!”

  1. thanks nigel, i was wondering if joomla had an option to rename the image files that are uploaded to the gallery already, or do i have to re upload every image from the harddrive and start again?

    1. Hi Kelly,

      Can you give me a little more context to what the problem is that you are trying to solve?
      To be honest I havent touched Joomla in 3 years so I’m sure a ton has changed since I stopped using it. Also what version of Joomla are you running?

      Cheers,
      Nigel.

Leave a Reply

Your email address will not be published. Required fields are marked *