Level 33
check your form HTML in the Blade file. it should be this
enctype="multipart/form-data"
and 2nd point may be an issue in this path public_path('uploads'),
run this command following
php artisan storage:link
Hello,
I want to upload a json file and Extract it in Controller and keep the data in Database. What will be the approach?
File Upload Controller:
public function fileUploadPost(Request $request)
{
dd($request);
$request->validate([
'file' => 'required|mimes:pdf,xlx,csv,json|max:2048',
]);
$fileName = time().'.'.$request->file->extension();
$request->file->move(public_path('uploads'), $fileName);
return back()
->with('success','You have successfully upload file.')
->with('file',$fileName);
}
File is not uploading!!!
dd() is giving me this output:
Please or to participate in this conversation.