-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[FeatureRequest]: Warn users when uploading duplicate file names to the media manager #3124
Comments
@buuug7 Just Create a folder then upload the same file into that folder |
I have same problem with the media manager. I override important file (that was uploaded in past) with newer file with same filename. I have few questions:
Thank you for answers |
@tgz-cz i have no best solutions, it seems only by modifying the source code of
|
@buuug7 feel free to submit a PR to add a warning popup if the file is going to get overwritten. |
@LukeTowers how to determin the two files the same ?
It not necessary to give the prompt when two files have a same filename, if upload file have the same filename with already updated files. just auto rename the filename. it was simple. that is also work when use richeditor upload file. source file only throw exception
rename file name
which better? |
I think the exception is better for now, until we get around to providing a popup that would let the user choose to rename the file on upload. |
@LukeTowers Ok |
Duplicate of #1117, closing that one and keeping this one open. |
@daftspunk can you add some event before file upload or when filename is generating? |
@MaxNozhkin there's the after upload event: https://octobercms.com/docs/api/media/file/upload. You could make a PR to propose a beforeUpload event if you'd like |
I found a solution to rename and return the renamed file to the richeditor, without change source code MediaManager
|
@pavelmgn submit a PR to pass the $filePath argument as a reference instead, header('Content-Type: application/json');
echo json_encode(['result' => 'success', 'link' => MediaLibrary::url($newPath)]);
exit(); is a pretty hacky solution that is unnecessarily brittle. I don't think changing the event argument for this case to pass by reference instead is going to cause any breaking changes so submit a PR and I'll merge it in. |
@LukeTowers #4612 |
This issue will be closed and archived in 3 days, as there has been no activity in the last 30 days. If this issue is still relevant or you would like to see action on it, please respond and we will get the ball rolling. |
#4616 makes |
@LukeTowers agreed, imo an option in the Settings enabling the automatic date in filename on/off or show warning with cancel/replace/keep both would be a good solution (just my 2cents) |
This issue will be closed and archived in 3 days, as there has been no activity in the last 30 days. |
This issue will be closed and archived in 3 days, as there has been no activity in the last 60 days. |
This issue will be closed and archived in 3 days, as there has been no activity in the last 60 days. |
This issue will be closed and archived in 3 days, as there has been no activity in the last 60 days. |
This issue will be closed and archived in 3 days, as there has been no activity in the last 60 days. |
This issue will be closed and archived in 3 days, as there has been no activity in the last 60 days. |
This is a good pickup. I have recorded this to be addressed in the next iteration of media manager. Thanks @buuug7! |
description
if upload two same name files into media manager, the files uploaded later will auto overwrite the previous file without prompt. what did i do for prevent auto overwrite? i have many files in one directory,about 5000, when i upload new files into media manager, i must check the file name first, but this become more difficulty when the numbers of files getting more and more .
did there have any good solutions?
The text was updated successfully, but these errors were encountered: