1
0
Fork 0

Remove temporary upload if we have a duplicate.

This commit is contained in:
Andrew Tomaka 2011-11-08 15:45:27 -05:00
parent 5e68235616
commit 6c2dab5c50

View file

@ -29,10 +29,12 @@ class Upload extends CI_Controller {
$duplicate = $this->fileupload->check_duplicate($hash); $duplicate = $this->fileupload->check_duplicate($hash);
if($duplicate) { if($duplicate) {
unlink($upload['full_path']);
$message = array('type'=>'error', 'status'=>'file already exists:' . $duplicate); $message = array('type'=>'error', 'status'=>'file already exists:' . $duplicate);
} else { } else {
$file_name = $this->fileupload->add_upload($upload['file_ext'], $upload['client_name'],$hash); $file_name = $this->fileupload->add_upload($upload['file_ext'], $upload['client_name'],$hash);
rename($upload['full_path'], $upload['file_path'] . $file_name . $upload['file_ext']); rename($upload['full_path'], $upload['file_path'] . $file_name . $upload['file_ext']);
$config = array( $config = array(