Reputation: 655
I am using Silverstripe 3.1.
If i try to upload a file(image) using the File Uploader from CMS and that file already exists, i get the following:
The thing i want is to add another button to "Use That File" instead of overwriting it. I think makes more sense and i tried to search deep in the File class but i could not find where shoud i start.
Upvotes: 1
Views: 97
Reputation: 4626
There is a config setting to tell UploadField NOT to overwrite the file but instead suffix it to avoid name conflicts:
$uploadField->getUpload()->setReplaceFile(false);
If you want it set globally, you can use config system like:
Upload:
replaceFile: false
which is the standard setting.
Upvotes: 1