1.首先修改ckeditor文件下的配置文件config.js
CKEDITOR.editorConfig = function( config )
{
var siteUrl = 'http://'+document.domain+'/';
};
2.upload.php文件,负责上传
<?php
$errRequestFunction = "Error as a function call requests"; //错误的功能调用请求
$errRequestFile = "Request the wrong file called"; //"错误的文件调用请求"
$errFileType = "The wrong file type"; //"错误的文件类型!"
$errUpfile = "File upload failed, please check the upload directory and directory read and write permissions set"; //"文件上传失败,请检查上传目录设置和目录读写权限"
$uploadExceed = "The uploaded file can not exceed"; //"上传的文件不能超过"
$config = array ();
$config ['type'] = array ("flash", "img" ); //上传允许type值
$config ['img'] = array ("jpg", "bmp", "gif" ); //img允许后缀
$config ['flash'] = array ("flv", "swf" ); //flash允许后缀
$config ['flash_size'] = 2000; //上传flash大小上限 单位:KB
$config ['img_size'] = 5000; //上传img大小上限 单位:KB
$config ['message'] = "Upload Success!"; //上传成功后显示的消息,若为空则不显示 上传成功
$config ['name'] = mktime (); //上传后的文件命名规则 这里以unix时间戳来命名
$config ['flash_dir'] = $_SERVER['DOCUMENT_ROOT']."/upload"; //上传flash文件地址 采用绝对地址 方便upload.php文件放在站内的任何位置 后面不加"/",上传的文件将放在网站根目录下的upload文件夹下
$config ['img_dir'] = $_SERVER['DOCUMENT_ROOT']."/upload"; //上传img文件地址 采用绝对地址 采用绝对地址 方便upload.php文件放在站内的任何位置 后面不加"/",上传的文件将放在网站根目录下的upload文件夹下
$config ['site_url'] = "http://www.xxx.com"; //网站的网址 这与图片上传后的地址有关 最后不加"/" 可留空
//没有文件夹时则创建
isDirAll($config ['flash_dir']);
isDirAll($config ['img_dir']);
//文件上传
uploadfile ();
function uploadfile() {
}
//输出js调用
function mkhtml($fn, $fileurl, $message) {
}
function isDirAll($dir) {
}
function isMkDir($dir = "") {
}
?>