No. WordPress does not care what your filenames are if you use its uploader, it will change them as it sees fit, and part of that is lowercasing them.
If you need filenames to not change, then do not use the WordPress uploader. Use FTP instead and link to those files directly.
Surely there must be a way around this. The site is for a client who will be using the uploader to set up the files then using a script to upload the updated files weekly. There must be a way to tell WP to NOT change case on file names. Anyone?
There must be a way to tell WP to NOT change case on file names.
Rewrite the function named wp_unique_filename in wp-includes/functions.php. That is what produces the new filename for uploaded files.
Thanks for the info on that. What I need is for WP to NOT change the filename at all. Leave the upper and lower case as well as the spaces and not replace them with dashes. If there anyone willing to do this for a fee? I wouldn’t expect anyone to donate their time doing this and would willingly pay for the assistance. It’s a bit over my head, unfortunately.
Anyone? If there is anyone who can made the edits to the functions for me, for pay, I’d sure appreciate it.
What I need is for WP to NOT change the filename at all.
Uh huh. And what happens when somebody uploads another file with the same name?
They are unique. Only one person is uploading files and they’re all unique PDFs. So that’s really not a problem. If this is not feasible, I’ll try to teach them better naming practices. That would be my first choice, but the contact person is less than amenable to changing ANYTHING in how he does things.
Sigh. I’d rather hoped you’d see the light, but whatever. On your own head be it.
function wp_unique_filename( $dir, $filename, $unique_filename_callback = NULL ) {
return $filename;
}
Replace that function with this one. Now you have no safety net.
Trust me.. I DO understand. I really do.
Difficult client + no patience = migraine for me. I cannot begin to tell you what a nightmare this client has been. *sighs wearily*
Thank you. That worked. I have the original backed up in case I can convince them it’s a better way to go. But I won’t hold my breath-blue face doesn’t go well with red hair!
I appreciate your assistance.