/** * (non-PHPdoc) * @see \tfc\mvc\interfaces\Action::run() */ public function run() { $req = Ap::getRequest(); $from = $req->getParam('from'); $ret = Upload::posts($_FILES['upload']); if ($this->isCkeditor($from)) { $callback = $req->getParam('CKEditorFuncNum', 1); $url = isset($ret['url']) ? $ret['url'] : ''; echo '<script type="text/javascript">'; echo 'window.parent.CKEDITOR.tools.callFunction(' . $callback . ', \'' . $url . "', '');"; echo '</script>'; exit; } $this->display($ret); }
/** * (non-PHPdoc) * @see \tfc\mvc\interfaces\Action::run() */ public function run() { $req = Ap::getRequest(); $ret = Upload::sysbatch($_FILES['upload']); $this->display($ret); }
/** * (non-PHPdoc) * @see \tfc\mvc\interfaces\Action::run() */ public function run() { $req = Ap::getRequest(); $ret = FileUpload::headPortrait($_FILES['file']); $this->display($ret); }
/** * 获取所有的图片文件 * @param integer $Ymd * @return array */ public function getFiles($Ymd) { $data = array(); if (($Ymd = (int) $Ymd) <= 0) { return $data; } $directory = $this->_directory . DS . substr($Ymd, 0, 6) . DS . substr($Ymd, 6); $fileNames = $this->scanDir($directory); $fileNames = array_reverse($fileNames); foreach ($fileNames as $fileName) { if (!is_file($fileName)) { continue; } $imgStat = Image::imgStat($fileName); $directory = isset($imgStat['directory']) ? $imgStat['directory'] : ''; $pictureName = isset($imgStat['basename']) ? $imgStat['basename'] : ''; $width = isset($imgStat['width']) ? $imgStat['width'] : 0; $height = isset($imgStat['height']) ? $imgStat['height'] : 0; $fileSize = isset($imgStat['filesize']) ? $imgStat['filesize'] / 1024 : 0; $dtCreated = isset($imgStat['ctime']) ? date('Y-m-d H:i:s', $imgStat['ctime']) : ''; $pictureUrl = Upload::getUrl($fileName); $fileSize = round($fileSize, 2) . 'KB'; $data[] = array('directory' => $directory, 'picture_name' => $pictureName, 'picture_url' => $pictureUrl, 'file_size' => $fileSize, 'width_height' => $width . '*' . $height, 'dt_created' => $dtCreated); } return $data; }