我在CKeditor上配置uploadimage插件允許拖放圖像時遇到一些困難。CKEditor拖放圖像上傳問題
我包括插件uploadimage和它的依賴uploadwidget。
這是上傳PHP文件:
$basePath = "/var/www/html/images/articles/";
$baseUrl = "/var/www/html/images/articles/";
$funcNum = $_REQUEST['CKEditorFuncNum'] ;
if (isset($_FILES['upload'])) {
$name = $_FILES['upload']['name'];
move_uploaded_file($_FILES["upload"]["tmp_name"], $basePath . $name);
$url = $baseUrl . $name ;
$message = 'new file uploaded';
}
else
{
$message = 'No file has been sent';
}
echo "<script type='text/javascript'> window.parent.CKEDITOR.tools.callFunction($funcNum, '$url', '$message')</script>";
問題是與CKEditorFuncNum,因爲我沒有收到來自任何形式。
文件正確上傳到$基本路徑,但功能window.parent.CKEDITOR.tools.callFunction會由於缺少和FuncNum
ckeditor.js:3 [CKEDITOR] Error code: filetools-response-error.
Object {responseText: "<br />↵<b>Notice</b>: Undefined index: CKEditorFu…icles/371c63d.jpg', 'new file uploaded')</script>"}
難道你們知道爲什麼我沒有收到來自任何$ _REQUEST ['CKEditorFuncNum']?
感謝
由於錯誤說你看起來沒有索引CKEditorFuncNum,試着用'var_dump($ _ REQUEST)'來檢查你的請求;' – SAZ
是的,它是正確的!我沒有收到CKeditorFuncNum索引,但我不明白爲什麼它不是來自編輯器 – paolo9785