I am using Jose Diaz-Gonzalez's Upload Plugin for uploading files and resizing them.
public $actsAs = array(
'Containable',
'Upload.Upload' => array(
'filename' => array(
'fields' => array(
'dir' => 'gallery'
),
'thumbnailSizes' => array(
'small' => '500x500',
),
'thumbnailMethod' => 'php',
'path' => '{ROOT}webroot{DS}img{DS}{model}{DS}',
'nameCallback' => 'filerename'
)
)
);
function filerename($currentName) {
debug($data);
debug($currentName);
return uniqid();
}
It works fine except that the file extension seems to be missing on the original file. I am not sure how to access the extension of the file so that I can append the same to the rename function