dongmeirang4679 2012-10-02 20:20
浏览 148

NicEdit:图片上传到自己的服务器不起作用 - >配置错误?

I have a problem regarding the nicEditor for textareas, to be more precise; the picture upload button.

My file index.php contains the where the nicEditor is called. In the same folder are two other folders: "images", where I want to store the files in and "includes", where nicEdit.js and nicUpload.php (which contains the Upload Code provided from the official site) are.

My problem is: When I want to upload a picture via nicEdit, the error message "Failed to upload image." appears, although I have set the follwoing parameters:

  • In nicEdit.js, nicURI is set to "includes/nicUpload.php"
  • In nicUpload.php, NICUPLOAD_PATH is defined as "./images" and NICUPLOAD_URI is defined as "images" (I tried several other combinations here, but none seems to work)
  • The folder "images" has permission 777

I wasted hours just doing try and error but I wasn't able to get any positive results doing so...

[edit]:

When I upload a bigger file, I can see the upload bar progessing, but as soon as it is complete, the "Failed to upload image" appears

the code in nicEdit.js includes:

var nicUploadButton=nicEditorAdvancedButton.extend({nicURI:'includes/nicUpload.php',errorText:"Failed to upload image",addPane:function ......
  • 写回答

6条回答 默认 最新

  • dsbm49845 2012-11-15 10:38
    关注

    nicEdit developers did something bad.

    They updated a version of nicUpload.js for the imgur.com, which is incompatible with nicUpload.php. When you download the lib from their page the server simply include the imgur version into nicEdit.js.

    I figure out how to make this work.

    Checkout their svn repository on version 23

      svn checkout http://svn.nicedit.com//trunk/nicUpload/
      svn update -r 23
    

    Edit the uncompressed version of nicEdit.js, delete code between

    /* START CONFIG */
    var nicUploadOptions = {
        buttons : {
            'upload' : {name : 'Upload Image', type : 'nicUploadButton'}
        }
    

    and

    nicEditors.registerPlugin(nicPlugin,nicUploadOptions);
    

    Paste nicUpload.js from nicUpload/ you got from svn.

    And delete this line:

    /* NICEDIT_REMOVE_START */,iconFiles : {'upload' : 'src/nicUpload/icons/upload.gif'}/* NICEDIT_REMOVE_END */
    
    评论

报告相同问题?

悬赏问题

  • ¥15 我的代码无法在vc++中运行呀,错误很多
  • ¥50 求一个win系统下运行的可自动抓取arm64架构deb安装包和其依赖包的软件。
  • ¥60 fail to initialize keyboard hotkeys through kernel.0000000000
  • ¥30 ppOCRLabel导出识别结果失败
  • ¥15 Centos7 / PETGEM
  • ¥15 csmar数据进行spss描述性统计分析
  • ¥15 各位请问平行检验趋势图这样要怎么调整?说标准差差异太大了
  • ¥15 delphi webbrowser组件网页下拉菜单自动选择问题
  • ¥15 wpf界面一直接收PLC给过来的信号,导致UI界面操作起来会卡顿
  • ¥15 init i2c:2 freq:100000[MAIXPY]: find ov2640[MAIXPY]: find ov sensor是main文件哪里有问题吗