Not sure if this is the most appropriate forum to post this to.
has anyone managed to get to grips with how the media/product and sub folders actually work.
We have some with capital letters some with lower case letters (for the folder names) both containing the same files. Lower case folder names contain image names that start in upper case and vice versa.
When we upload new images they go into one set of folders then appear to get moved to another. Sometimes into the lower case folder names sometimes into the upper case names.
it is just a bit of a mystery to how this actually works.
it would be good to know what the various folders are for and at what point images get moved around between folders
Windows based systems don’t care about case. So, if I upload Lee.jpeg and lee.jpeg, they are essentially the same filename.
When you upload a file via Magento, the Varien_File_Uploader class does all the work finding a home for a file. You give it a base directory and list of valid extensions. You can also set a flag to make is use ‘dispersion’. When you tell it to use dispersion, it takes the first 2 letters of the filename and makes a directory structure.
lee.jpeg -> /l/e/lee.jpeg
Bob.jpeg -> /B/o/Bob.jpeg
Well, on a UNIX system case matters. So the directory /B/o is NOT the same as /b/o
Window doesn’t care about case. /B/o === /b/o
Now to what is probably happening for you.
You are probably uploading mixed case files.
The first file you upload is ‘lee.jpeg’, that becomes ‘/l/e/lee.jpeg’
The second file you upload is ‘LEland.jpeg’, that becomes ‘/l/e/LEland.jpeg’ in windows and ‘/L/E/LEland.jpeg’ in UNIX
The reason is that windows thinks /L/E === /l/e and says the directory already exists. So, Magento uses /L/E/LEland.jpeg and windows saves it in /l/e/LEland.jpeg
Magento should probably lowercase every filename to cover edge cases between windows and UNIX to be honest.
Of course, I could be totally wrong and you should just ignore everything I just said in that case.
Your explanation helps us a lot - thanks for that - but wer are seeing slightly different results from what you are stating:
all of our images are lower case (it is part of our internal process for image preperation
we are seeing lower case image names in upper case folders and vice versa
images appear to move directories - e.g. move (or rather copied) from an upper case folder to a lower case one.
I could be wrong on the latter, but I am almost sure.
thanks again for taking the time to respond - much appreciated.