我正在尝试使用Ckeditor 5为我的laravel项目设置图像上传,但图像上传不起作用
<textarea name="body" class="editor">{{old('body')}}</textarea>
<script>
ClassicEditor
.create( document.querySelector( '.editor' ) )
.then( editor => {
} )
.catch( error => {
console.error( error );
} );
</script>
发布于 2019-09-08 07:45:46
没有使用Ckeditor 5,而是使用summernote作为我的编辑器。
下面是控制器中处理请求的代码:
// check if files were uploaded and process them
$uploadedFiles = $request->allFiles();
foreach ($uploadedFiles as $key => $file) {
// store the file and set it's path to the value of the key holding it
if ($file->isValid()) {
$input[$key] = $file->store('fb_uploads', 'public');
}
}
确保表单标签包含要发送的数据的enctype="multipart/form-data"
。
我希望这能帮到你。
https://stackoverflow.com/questions/57838133
复制相似问题