public function beforeValidate()
{
if (!$this->_source_path) {
// the file should be in place
$path = $this->getPath();
if (!$this->mimetype) {
$this->mimetype = $this->lookupMimetype($path);
}
if (!$this->size) {
$this->size = filesize($path);
}
}
return parent::beforeValidate();
}