Niceedit本地上传图片失败
-
11-12-2019 - |
题
我是这样称呼编辑的:
new nicEditor({
buttonList : ['bold','italic','underline','upload'],
iconsPath:'img/nicedit.png',
uploadURI : 'http://server.com/integracion/files/nicUpload.php'
}).panelInstance(textareaId);
并且 .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
但我在上传完成后做出响应(当然还有来自 nicedit 的警报..)
<script>
try {
top.nicUploadButton.statusCb({"error":"Invalid Upload ID"});
} catch(e) { alert(e.message); }
</script>
我缺少什么?
-编辑
我认为问题可能出在 php 文件中:
$id = $_POST['APC_UPLOAD_PROGRESS']; /* APC is installed and enabled */
if(empty($id)) {
$id = $_GET['id'];
}
解决方案
最终编辑:
我已经设法制作了这项工作!
这里是一个工作示例:
http://simplestudio.rs/yard/nicedit/
上传的图像将在此处存储:
http://simplestudio.rs/yard/nicedit/images/
和这里是整个代码,只需解压缩它并放在您的服务器上,主要是我需要调整Nicedit.js,因为它有一些问题。
http://simplestudio.rs/yard/nicedit/nicedit.rar
只需使用该文件和通过查看我的示例,使您的代码“,它将工作:)
- 您还需要安装PHP APC,以便此脚本可以工作:
http://php.net/manual/en/apc.installation.php如果你的任何意思有一些问题,我在这里解决它。
- 我不会在我的服务器上删除这个例子,以便拥有这个问题的每个人都可以自由下载它...
其他提示
不隶属于 StackOverflow