我目前正在尝试首次实现所见即所得的编辑器。我正在尝试上传图片,因为它向我发送了405(不允许使用方法),因此我很费力。
// Set the image upload parameter.
imageUploadParam: 'image_param',
// Set request type.
imageUploadMethod: 'POST',
// Set the image upload URL.
imageUploadURL: '/image/post',
// Additional upload params.
imageUploadParams: {
_token: "{{ csrf_token() }}"
},
// Set max image size to 5MB.
imageMaxSize: 5 * 1024 * 1024,
// Allow to upload PNG and JPG.
imageAllowedTypes: ['jpeg', 'jpg', 'png']
我的路线是:
Route::post('image/post', 'Admin\NewsController@uploadImage')->name('admin.news.image.store');
所以,如果我使用POST路由并在Froala请求中也说POST,我不明白为什么会得到405(不允许使用方法)。>
我目前正在尝试首次实现所见即所得的编辑器。我在尝试上传图片时遇到了麻烦,因为它向我发送了405(不允许使用方法)。 //设置图片上传参数。...
您在标头中缺少CSRF(而不是作为参数)。一些细节在这里: