doutuan4361
2018-08-09 16:41
浏览 222
已采纳

Ckeditor 5文件上传适配器错误

I'm using ckeditor classic 5, and i'm trying to upload images in it. I downloaded php lib Ckfinder3 php connector, set config.

When i'm trying to load image i have a massage: Cannot upload file *filename*.

Interesting moment, that they are fisically loaded on server: i can view it in directory, that set in my config file and this files are correct:

/var/www/projectfiles/downloadfiles/

The next step i'm check permission and groups: it's www-data 0777.

What can be a reason? Can you give some advice or solution?

Thanks!

UPD: init function

ClassicEditor
            .create( document.querySelector( '#material_preview' ), {
                ckfinder: {
                    uploadUrl: '/ckfinder/connector/?command=QuickUpload&type=Images'
                }

            } )
            .catch( error => {
                console.error( error );
            } );

php config:

$config['authentication'] = function () {
    return true;
};

$config['backends']['default'] = array(
    'name'         => 'default',
    'adapter'      => 'local',
    'baseUrl'      => 'http://files.project.com/downloadfiles/',
    'root'         => '/var/www/projectfiles/downloadfiles/',
    'chmodFiles'   => 0777,
    'chmodFolders' => 0777,
    'filesystemEncoding' => 'UTF-8'
);
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • dqn8235 2018-08-20 16:43
    已采纳

    Finally i got it!

    The connector path is valid. The problem was in cache folder's permisson in laravel. Be glad if it helps you.

    打赏 评论
  • dtvpe4837413 2018-08-18 08:41

    The connector path looks invalid. For PHP it should be something like: '/ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files' Please have a look at CKEditor integration examples in CKFinder demo: https://ckeditor.com/docs/ckfinder/demo/ckfinder3/samples/ckeditor.html

    打赏 评论

相关推荐 更多相似问题