Fixed to have correct post failure cleaning of the uploaded file.
Note: Latest Pluf release needed.
This commit is contained in:
parent
93c44feb05
commit
eb60e99d5c
@ -109,6 +109,18 @@ class IDF_Form_Upload extends Pluf_Form
|
|||||||
return $this->cleaned_data;
|
return $this->cleaned_data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* If we have uploaded a file, but the form failed remove it.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
function failed()
|
||||||
|
{
|
||||||
|
if (!empty($this->cleaned_data['file'])
|
||||||
|
and file_exists(Pluf::f('upload_path').'/'.$this->project->shortname.'/files/'.$this->cleaned_data['file'])) {
|
||||||
|
@unlink(Pluf::f('upload_path').'/'.$this->project->shortname.'/files/'.$this->cleaned_data['file']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Save the model in the database.
|
* Save the model in the database.
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user