Duplication of Images with same name

Permalink
HI All ,

I am creating a website which has lots of images and files , I am facing the Issue of Duplicate Images . I am able to Upload Image that already exists with same name and concrete5 does not ask whether it wants to replace that image .

Any option to Show a Alert saying Replace with Existing Image or Cancel .

First Attachment shows the first upload
Second shows the duplicate upload of the first image with same name
Third Attachment shows the Duplicate Images in File Manager

3 Attachments

 
mrjcgoodwin replied on at Permalink Reply 1 Attachment
mrjcgoodwin
In the file manager you can click on an image and choose the option 'replace'. (See screen grab).
siton replied on at Permalink Reply
siton
In big picture projects its better to manage/sort/filter/rename and so on in windows (or mac) folders and than only upload the right files to your site (in any CMS).

Also rename files for more human readable manage ("john-wedding01" "john-wedding02") instead of "345edfgdfgdcxfgdfg" and "345edfgdfgdcxfgdfg2sdf") could help avoid duplicates.

And of course delete duplicate pictures before you start using them (sort by title for example).

About "copy and replace" concept:
In new/empty site its really good feature. But in "regular" site its hard to know where you use this pictures. If by mistake you replace pic with other pic with the same name ("pic1.jpeg"), and/or the same pic with other crop size it could cause a lot or problems of layout and content. To much risk.

If you dont yet use this pictures - maybe delete all pics and upload again this files. If you want to change the same image use "replace" - like mrjcgoodwin said.
mohamedkhalid replied on at Permalink Reply 1 Attachment
Thank you for the quick reply, but can i get something like the file with that name already exists do you want to replace or change the file name ?

You can take a look at the image for better understanding .
MrKDilkington replied on at Permalink Reply
MrKDilkington
Hi mohamedkhalid,

The files you upload may be the same and use the same filename, but their file path is different.

This is an assumption, but I believe that allowing for multiple files with the same name was done on purpose. On a large site, with many files and many users, someone may have already uploaded "lion.jpg". Another user may also want to upload "lion.jpg", their file may be a different image, but shares the same filename. If this user was able to overwrite/replace the first "lion.jpg", now that content would be replaced with the wrong image.
khalid1 replied on at Permalink Reply
Hi Everyone ,

Is there a way atleast to show a Alert message( this file name already exists please change the name .) instead of replacing the image that already exists .

And doesn't upload till the name is different .

Hoping for an Solution .
MrKDilkington replied on at Permalink Reply
MrKDilkington
@mohamedkhalid

I don't know a lot about how the system processes uploaded files, but I have a feeling that adding an alert like this may not be a simple task.

An alternative is saving the images you have uploaded in a folder and then using an image/filename comparison program to compare them to images you want to upload. When the program flags duplicate images or filenames, you can skip uploading those images.
khalid1 replied on at Permalink Reply
Thank you for the reply MrK . I'll surely try image/file name comparison program . But Concrete5 immediately uploads the file once clicked on it , so how do we stop from uploading the image when i file with the same name .
frz replied on at Permalink Reply
frz
If your client wants to replace a file, you can do that from the file manager easily by clicking "Replace" from the file you want to replace.

Conversely, if your client wants a system powerful enough to handle many "image001.jpg" files without horrible unpredictable accidents happening, they have that today in concrete5.


Today, you can replace a file by simply finding it first. You can upload multiple files of the same name safely as well. Your request of parsing any incoming file to see if it has the same file name as another file and then asking what to do with it does not seems like a fair amount of work to add for a feature that feels pretty well covered already. Given the complex nature of bulk uploads and now folders & permissions on files that we're launching with version 8, this strikes me as way more effort than its worth to make one client happy about their particular expectations about how a system should work.

Another alternative might be to create a custom form for them somewhere to handle their custom need. If they're really just replacing a photo of the day every day or something, just build a custom UX to do that, and leave the core file manager alone.

That's how it feels to me at the moment, feel free to get a bunch of people to explain to me why I'm wrong and submit a pull request on github to make it right.
mohamedkhalid replied on at Permalink Reply
I was able to show a message

just had to edit this file \concrete\elements\files\properties.php

Get the filename uploaded now ($name=h($fv->getTitle())) check in table 'fileversions' whether more then one file exists with the same name .if yes then show the error next to file name saying file with same name exists please replace