diff --git a/application/admin/controllers/DataController.php b/application/admin/controllers/DataController.php index f52df5bc..0548b281 100755 --- a/application/admin/controllers/DataController.php +++ b/application/admin/controllers/DataController.php @@ -1436,8 +1436,8 @@ class Admin_DataController extends Zend_Controller_Action exit(); } - $files=new files(); - $msg = $files -> upload($this->view->config->upload,$_FILES['Filedata'],'md'); + $files=new files(); + $msg = $files -> upload($this->view->config->upload,$_FILES['Filedata'],empty($uuid)?'file':'md'); if(empty($msg['error'])) { @@ -1456,7 +1456,7 @@ class Admin_DataController extends Zend_Controller_Action $msg['attid'] = $attid = $att['id']; $sql = "insert into mdattach (uuid,id) values ('$uuid','$attid')"; - if($this->db->exec($sql)) + if(empty($uuid) || $this->db->exec($sql)) { $msg['html'] = $realname.'['. round($filesize/1024,2) .' kb]
'; echo Zend_Json::encode($msg);