gpt4 book ai didi

php - Nicedit 本地上传图片失败

转载 作者:可可西里 更新时间:2023-10-31 23:52:40 24 4
gpt4 key购买 nike

我是这样称呼编辑器的:

new nicEditor({
buttonList : ['bold','italic','underline','upload'],
iconsPath:'img/nicedit.png',
uploadURI : 'http://server.com/integracion/files/nicUpload.php'
}).panelInstance(textareaId);

并且 .php 文件存在(我是 Docs 中的那个,我更新了目标路径)

/* 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

只需使用该 js 文件编写您的代码,并通过查看我的示例,它就可以工作:)

如果您有任何问题,我会在这里解决。

  • 我不会在我的服务器上删除这个例子,这样所有遇到这个问题的人都可以免费下载...

关于php - Nicedit 本地上传图片失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/12662062/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com