/** * 处理上传图片,重命名放到指定目录下,这里这个函数用来上传用户头像 * */ public function image() { //上传控件的名称是upload $fileUpload = new FileUpload('upload', $_POST['MAX_FILE_SIZE']); $ckefn = $_GET['CKEditorFuncNum']; $path = $fileUpload->getPath(); $img = new Image($path); $img->ckeImg(650, 0); $img->out(); echo "<script>window.parent.CKEDITOR.tools.callFunction({$ckefn},\"{$path}\", '图片上传成功')</script>"; }
public function ckeUp() { if (isset($_GET['type'])) { //查看了源代码,他的名称是:upload $_fileupload = new FileUpload('upload', $_POST['MAX_FILE_SIZE']); $_ckefn = $_GET['CKEditorFuncNum']; $_path = $_fileupload->getPath(); $_img = new Image($_path); $_img->ckeImg(650, 0); $_img->out(); echo "<script type='text/javascript'>window.parent.CKEDITOR.tools.callFunction({$_ckefn},\".{$_path}\",'图片上传成功!');</script>"; exit; } else { Tool::alertBack('警告:由于非法操作导致上传失败!'); } }
public function upload() { $fileupload = new FileUpload('pic', 400); echo $fileupload->getPath(); }
<?php require substr(dirname(__FILE__), 0, -7) . '/init.inc.php'; if (isset($_GET['type'])) { //查看了源代码,他的名称是:upload $_fileupload = new FileUpload('upload', $_POST['MAX_FILE_SIZE']); $_ckefn = $_GET['CKEditorFuncNum']; $_path = $_fileupload->getPath(); $_img = new Image($_path); $_img->ckeImg(650, 0); $_img->out(); echo "<script type='text/javascript'>window.parent.CKEDITOR.tools.callFunction({$_ckefn},\"{$_path}\",'图片上传成功!');</script>"; exit; } else { Tool::alertBack('警告:由于非法操作导致上传失败!'); }