HTTP error occurred during file upload (File not found).
https://lamtakam.com/qanda/2396/HTTP-error-occurred-during-file-upload-File-not-found 1CKEditor با آپلود تصویر کار نمیکنه که من textarea
دارم با آی دی body
.
سپس در جاواسکریپت خط زیر را اجرا کردم.
<script>
CKEDITOR.replace('body', {
extraPlugins: 'easyimage',
filebrowserUploadUrl : '/admin/panel/upload-image',
filebrowserImageUploadUrl : '/admin/panel/upload-image'
});
</script>
web.php
Route::post('admin/images', 'DashboardController@uploadImageSubject')->name('images');
DashboardController.php
public function uploadImageSubject()
{
$this->validate(request() , [
'upload' => 'required|mimes:jpeg,png,bmp',
]);
$year = Carbon::now()->year;
$imagePath = "/upload/images/{$year}/";
$file = request()->file('upload');
$filename = $file->getClientOriginalName();
if(file_exists(public_path($imagePath) . $filename)) {
$filename = Carbon::now()->timestamp . $filename;
}
$file->move(public_path($imagePath) , $filename);
$url = $imagePath . $filename;
return "<script>window.parent.CKEDITOR.tools.callFunction(1 , '{$url}' , '')</script>";
}
اما هنوز اطلاعات باز نشده خطای زیر میده