Support » Requests and Feedback » uploads changing case of names

  • I notice that when I use the uploader, WP is changing all the letters to lower case. Can I fix that? It really won’t work well as there are upper case letters in the file names and they need to stay that way.
    Thanks for any help or guidance on this!

Viewing 10 replies - 1 through 10 (of 10 total)
  • Moderator Samuel Wood (Otto)

    (@otto42) Admin

    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?

    Moderator Samuel Wood (Otto)

    (@otto42) Admin

    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.

    Moderator Samuel Wood (Otto)

    (@otto42) Admin

    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.

    Moderator Samuel Wood (Otto)

    (@otto42) Admin

    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.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘uploads changing case of names’ is closed to new replies.