Ton*_*bet 3 javascript php upload nicedit
这就是我打电话给编辑的方式:
new nicEditor({
buttonList : ['bold','italic','underline','upload'],
iconsPath:'img/nicedit.png',
uploadURI : 'http://server.com/integracion/files/nicUpload.php'
}).panelInstance(textareaId);
Run Code Online (Sandbox Code Playgroud)
并且.php文件存在(我是文档中的那个,我更新了目标路径)
/* I want them here http://server.com/integracion/files/uploads/ so... */
define('NICUPLOAD_PATH', './uploads'); // Set the path (relative or absolute) to
// the directory to save image files
define('NICUPLOAD_URI', '/uploads'); // Set the URL (relative or absolute) to
// the directory defined above
Run Code Online (Sandbox Code Playgroud)
但是我在上传完成时做出响应(以及从nicedit中提取警告......)
<script>
try {
top.nicUploadButton.statusCb({"error":"Invalid Upload ID"});
} catch(e) { alert(e.message); }
</script>
Run Code Online (Sandbox Code Playgroud)
我错过了什么?
-编辑
我认为问题可能出在php文件中:
$id = $_POST['APC_UPLOAD_PROGRESS']; /* APC is installed and enabled */
if(empty($id)) {
$id = $_GET['id'];
}
Run Code Online (Sandbox Code Playgroud)
Dev*_*ger 19
最终编辑:
我成功完成了这项工作!
这是一个工作示例:http :
//simplestudio.rs/yard/nicedit/
上传的图像将存储在这里:http :
//simplestudio.rs/yard/nicedit/images/
这是整个代码,只需将其解压缩并放在您的服务器上,主要是我需要调整nicEdit.js,因为它有一些问题.
http://simplestudio.rs/yard/nicedit/nicedit.rar
只需使用该js文件制作代码,并通过查看我的示例,它将工作:)
如果你有任何意思有问题我在这里解决它.