Example #1
0
 protected function common_FileTmp_delete_upload($upload_type = 'img')
 {
     $this->controller_common_api(function () use($upload_type) {
         $id = (int) Input::post('id');
         $file_tmp = Model_FileTmp::check_authority($id, $this->u->id, null, 'member_id', IS_ADMIN ? 1 : 0);
         $options = Site_Upload::get_upload_handler_options($this->u->id, IS_ADMIN, true, null, 0, true, $upload_type);
         $uploadhandler = new MyUploadHandler($options, false);
         \DB::start_transaction();
         $this->response_body = $uploadhandler->delete(false, $file_tmp);
         \DB::commit_transaction();
         return $this->response_body;
     });
 }