SiobhanElara
asked on
How can I do a case sensitive FileExists in CFML?
I've inherited an ancient Cold Fusion site and the file structure that comes with it. My issue is that it had been on a Linux server (case sensitive) and is now on a Windows server (case insensitive) which is causing conflicts. The file names are stored in a MySQL database and the code to render them is simply:
<img src="img/projects/#photo_file#" alt="#photo_name#"/>
Is there a way to check if a file with the exact name exists, like if the stored name in the database is mypic.jpg it won't return MYPIC.JPG? I've found a lot of people asking how to make comparisons case insensitive, but not the other way around. Thanks!
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Glad it worked!
Curious again - so now you are going to rename files? What's the next step? Just curious ...
Curious again - so now you are going to rename files? What's the next step? Just curious ...
ASKER
I'm honestly not sure; this is obviously a stopgap measure, but it doesn't look like we were supplied with all the required images (since there may be records for pic.jpg, PIC.JPG, Pic.jpg, and pic.JPG but we only have pic.jpg in the archive file.) I'll have to see if I can get access to the old server and, if so, hopefully write some code to automate the renaming and updating of records.
Right! Cause as you know on Windows abc.jpg cannot exist in the same folder as ABC.jpg. I'm wondering if during a copy to give you guys the files if duplicates were simply eliminated - or renamed.
Anyway good luck! Have a great day!
Anyway good luck! Have a great day!
ASKER
I did what you recommended and it's working exactly as I wanted... thanks so much!