jrbasso/MeioUpload

removeOriginal Dont work

ali786 opened this issue · 1 comments

hi removeOriginal Dont work !

i want upload thumbs only

(cakephp 2.1.2)

thanks

I had the same problem.
This feature only works when useTable = false in the model.

This project is now depreciated but for anyone with the same issue who doesn't want to migrate:
Open Model/Behavior/MeioUploadBehavior.php
Look for this block of code which appears TWICE:
// If the file is an image, try to make the thumbnails
if ((count($options['thumbsizes']) > 0) && count($options['allowedExt']) > 0 && in_array($data[$model->alias][$fieldName]['type'], $this->_imageTypes)) {
$this->_createThumbnails($model, $data, $fieldName, $saveAs, $ext, $options);
}

After the SECOND instance insert the following code (which does appear already under the first instance):
if ($options['removeOriginal']) {
$this->_removeOriginal($saveAs);
}