質問

これは私がエディタの呼び出し方法です:

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
.

しかし、アップロードが完了したとき(そしてCorseのNiceditからの警告。)

<script>
        try {
            top.nicUploadButton.statusCb({"error":"Invalid Upload ID"});
        } catch(e) { alert(e.message); }
    </script>
.

私は何が足りないの?

readit

問題は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ファイルでコードを作成し、私の例を見ることで機能します。)

他のヒント

画像アップロードの責任のあるコードはメソッドuploadFileで、uploadURIオプションパラメータを探しています。

IMGURの1つの代わりにカスタムレスポンスを解析するには、onUploadedイベントハンドラを変更して、カスタムレスポンスを解析する必要があります(サンプル)。デフォルトでは、少なくとも{"upload": { "links": {"original": "http://..."}, "image": {"width": "123" } }}が期待されています。

申し訳ありませんが、 formdata()でサーバー側を処理します。

詳細については、NiceSit webサイトのデモページを試すことができますFireBugまたはWebInspectorを使用してネットワーク要求をスヌープ、およびもちろん、ソースコード。

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top