加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > PHP教程 > 正文

php – Nicedit本地上传图片失败

发布时间:2020-12-13 22:19:18 所属栏目:PHP教程 来源:网络整理
导读:这就是我打电话给编辑的方式: new nicEditor({ buttonList : ['bold','italic','underline','upload'],iconsPath:'img/nicedit.png',uploadURI : 'http://server.com/integracion/files/nicUpload.php'}).panelInstance(textareaId); 并且.php文件存在(我是
这就是我打电话给编辑的方式:

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 APC,以便此脚本可以工作:
http://php.net/manual/en/apc.installation.php

如果你有任何意思有问题我在这里解决它.

>我不会在我的服务器上删除此示例,以便每个有此问题的人都可以免费下载它…

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读