Nicedit本地上传图片失败 [英] Nicedit upload images locally fails
问题描述
这就是我调用编辑器的方式:
This is how I call the editor:
new nicEditor({
buttonList : ['bold','italic','underline','upload'],
iconsPath:'img/nicedit.png',
uploadURI : 'http://server.com/integracion/files/nicUpload.php'
}).panelInstance(textareaId);
并且.php文件存在(我是文档,我更新了目标路径)
And the .php file exists ( and I the one in the Docs, and I updated the target paths )
/* 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发出警告......)
But I on response when upload completes (and of corse an alert from nicedit..)
<script>
try {
top.nicUploadButton.statusCb({"error":"Invalid Upload ID"});
} catch(e) { alert(e.message); }
</script>
我错过了什么?
- 编辑
我认为问题可能出在php文件中:
I think the problem might be in the php file:
$id = $_POST['APC_UPLOAD_PROGRESS']; /* APC is installed and enabled */
if(empty($id)) {
$id = $_GET['id'];
}
推荐答案
最终编辑:
我已成功完成这项工作!
I have managed to make this work!
这是一个有效的例子:
http://simplestudio.rs/yard/nicedit/
上传的图片将存储在此处:
http://simplestudio.rs/yard/nicedit/images/
这里是整个代码,只需解压缩并放在你的服务器上,主要是我需要调整nicEdit.js,因为它有一些问题。
http://simplestudio.rs/yard/nicedit/nicedit.rar
只需使用该js文件制作代码,并查看我的示例,它就可以工作:)
Just make your code with that js file and by looking at my example, it will work :)
- 您还需要安装php APC以便这个脚本可以工作:
http:// php .net / manual / en / apc.installation.php
- Also you need to have php APC installed so that this script can work:
http://php.net/manual/en/apc.installation.php
如果你的意思有问题我在这里解决它。
If you by any mean have some problems I am here to solve it.
- 我不会在我的服务器上删除这个例子,所以有这个问题的人都可以免费下载...
这篇关于Nicedit本地上传图片失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!