문제

이것이 제가 편집자를 호출하는 방법입니다:

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

하지만 업로드가 완료되면 응답합니다(그리고 당연히 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/niceit/images/

와 여기에 전체 코드가 있으며, 그냥 포장을 풀고 서버에 넣으십시오. 주로 문제가 있었기 때문에 Nicedit.js를 조정해야했습니다.
http://simplestudio.rs/yard/niceprestudio.rs/yard/nicedit/nicedit.rar

해당 JS 파일로 코드를 만들고 예를 살펴 보면서 작동합니다.)

  • 또한이 스크립트가 작동 할 수 있도록 PHP APC가 설치되어 있어야합니다. http://php.net/manual/en/apc.installation.php

    어떤 의미가있는 경우에 나는 그것을 해결하기 위해 여기에 있습니다.

    • 이 문제가있는 모든 사람들이 자유롭게 다운로드 할 수 있도록 내 서버 에서이 예제를 삭제하지 않습니다.

다른 팁

이미지 업로드를 담당하는 코드는 다음과 같습니다. uploadFile, 찾고 있습니다 uploadURI 옵션 매개변수.

수정해야 할 것입니다. onUploaded imgur의 응답 대신 사용자 정의 응답을 구문 분석하는 이벤트 핸들러(견본).기본적으로 최소한 {"upload": { "links": {"original": "http://..."}, "image": {"width": "123" } }}.

죄송하지만 그 일에는 도움을 드릴 수 없습니다 양식데이터() PHP로 서버 측을 처리합니다.

자세한 내용은 nicEdit의 데모 페이지를 참조하세요. 웹사이트 Firebug 또는 WebInspector를 사용하여 네트워크 요청은 물론 소스 코드를 스누핑합니다.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top