yun(); $options = array(); $method = Dever::load('upload/lib/view/sina')->connect($yun, $this->config, $file); $ret = $method->upload($file, $this->data['file']['tmp_name'], $options, $this->base64); if ($ret) { $this->file = $this->output['url']; $file = Dever::load('upload/file-name', array('where_name' => $this->name, 'where_upload' => $this->data['key'], 'rand' => time())); if (isset($file) && $file) { $this->update($file['id']); } else { $this->insert(); } return $this->output['url']; } } public function file() { if ($this->base64 && isset($this->data['local'])) { $data = parse_url($this->data['local']); $data['path'] = str_replace(Dever::data() . 'upload/', '', $data['path']); $this->path = ltrim($data['path'], '/'); } $this->file = $this->path . $this->name . $this->ext; $this->output['file'] = $this->file; $this->output['url'] = $this->host . $this->file; //$this->output['url'] = '{uploadYun}' . $this->file; return $this->output['file']; } public function handle_w($water) {} public function handle_t($id) {} public function handle_c($id) {} }