Merge pull request #2603 from chillu/pulls/htmleditor-upload-replace

Default UploadField to replace files
This commit is contained in:
Damian Mooyman 2013-10-31 15:25:22 -07:00
commit fbf64c8c48

View File

@ -1147,6 +1147,11 @@ class UploadField extends FileField {
$fileObject = Object::create($relationClass);
}
// Allow replacing files (rather than renaming a duplicate) when warning about overwrites
if($this->getConfig('overwriteWarning')) {
$this->upload->setReplaceFile(true);
}
// Get the uploaded file into a new file object.
try {
$this->upload->loadIntoFile($tmpFile, $fileObject, $this->getFolderName());