使用ckeditor5简单上传适配器上传图像时发送自定义数据

问题描述 投票:0回答:1

我正在使用ckeditor5的simple upload adapter在laravel 6项目中上传图像。在我的刀片视图文件中,我有以下代码:

<script>
        ClassicEditor
            .create( document.querySelector( '#description' ), {
                simpleUpload: {
                    // The URL that the images are uploaded to.
                    uploadUrl: "{{ route('images.store') }}",

                    // Headers sent along with the XMLHttpRequest to the upload server.
                    headers: {
                        'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content'),
                    },
                }
            } )
            .catch( error => {
                        console.error( error );
                    } );
</script>

我想通过图像上传ajax请求发送以下数据-

{
  "reportImage" : "1"
}

我该如何实现?

ajax laravel ckeditor laravel-6 ckeditor5
1个回答
0
投票

您可以通过标题发送它。

© www.soinside.com 2019 - 2024. All rights reserved.