Make WordPress Core

Opened 7 years ago

Last modified 7 years ago

#40289 reopened defect (bug)

Uploading 2 files with the same name but different casing, overwrites existing files

Reported by: quickim's profile quickim Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 4.7.3
Component: Media Keywords: has-screenshots
Focuses: administration Cc:


Problem: Under normal circumstances, if I upload a file to the media library but a file with a similar name was previously uploaded, wordpress would change the name of the new file (by adding a dash and a number).
However, If I upload 2 files with the same name, BUT WITH DIFFERENT CAPITALIZATION, wordpress won't rename the second file and will just reference the older one.
So if for example, I already had the file cover.jpg in my library and I've created a new post and uploaded the file COVER.JPG, it will show in the post the older image of (cover.jpg).

Attachments (1)

everest-EVEREST-media-library.png (225.0 KB) - added by subrataemfluence 7 years ago.

Download all attachments as: .zip

Change History (9)

#1 @subrataemfluence
7 years ago

  • Keywords has-screenshots added

I tried to reproduce your issue at my local but everything seems to work OK.

Here is what I did:

  1. Downloaded two different images from google and named them as "everest.jpg" and "EVEREST.jpg"
  2. Uploaded "everest.jpg" directly to media library.
  3. Created a new post and this time selected "EVEREST.jpg" from media library and uploaded it
  4. Opened Media Library (admin) and I can see different images are showing up, i.e. everest.jpg and EVEREST.jpg are different as they should be. Please see screenshot.

Let me know if I need to do something else in order to reproduce the exact issue. Otherwise I suspect some sort of caching issue is working in the background for you.

Environment information:

OS: Ubuntu 14.04
WP version: 4.7.3
Browser: Chrome (Version 57.0.2987.110 (64-bit))

#2 @thamaraiselvam
7 years ago

  • Resolution set to worksforme
  • Status changed from new to closed

Could not reproduce the error, Working fine for me too.

#3 @quickim
7 years ago

  • Resolution worksforme deleted
  • Status changed from closed to reopened

Tried again, this time even simplified the process and same thing has happened:

  1. Create two different images locally (in different folders cos I'm using windowz): testy.jpg and TESTY.jpg
  2. Uploaded both directly to the media library
  3. Opened the library and I could see both files in the library with the correct thumbnails.
  4. BUT - when I open them (by clicking their name), they both show the same image.

Here are the screenshots of the result in WP:

And here are the direct links to the images I uploaded to my server:

And lastly, here are the same images, but this time as thumbnails -
Try opening both in different tabs and then refresh each of them once and notice the image actually changes:

Thanx again

#4 @subrataemfluence
7 years ago

Repeated your steps but still could not reproduce the issue. As I said it looks like some sort of caching or something else is going wrong with your hosting provider. It is a good choice to contact them.

Also this is a good time to cross check by trying to reproduce the issue at your local development server. If this works OK then definitely you need to find out what is going wrong with your hosting server.

#5 @thamaraiselvam
7 years ago

@subrataemfluence Did you try it on windows? I could not reproduce on Linux.

#6 follow-up: @subrataemfluence
7 years ago

@thamaraiselvam No I tested it in Ubuntu. But I believe the hosting provider for is a Linux server. as I don't think the site is hosted on a Windows server (ideally!)

#7 in reply to: ↑ 6 @thamaraiselvam
7 years ago

Replying to subrataemfluence:

@thamaraiselvam No I tested it in Ubuntu. But I believe the hosting provider for is a Linux server. as I don't think the site is hosted on a Windows server (ideally!)

Agreed :+1:

#8 @webstarters
7 years ago

@thamaraiselvam i tested on, and it worked well.


Last edited 7 years ago by ocean90 (previous) (diff)
Note: See TracTickets for help on using tickets.