3 months ago

Problem in uploading a file

Posted 3 months ago by raviSoni

Hello everyone i need to upload a file in database but i got error

my view file is

<div class="modal-content">
 <div class="modal-header">
 <button type="button" class="close" data-dismiss="modal">&times;</button>
   <h4 class="modal-title">File upload form</h4>
    <div class="modal-body">
    <!-- Form -->
    <form method="post" action="{{ route('upload.file') }}" enctype="multipart/form-data">
    {{ csrf_field() }}
    Select file : <input type='file' name='file' id='file' class='form-control' ><br>
    <input type='submit' class='btn btn-info' value='Upload' id='upload'>

my controller is

public function store(Request $request) { if($request->hasFile('file')) {

        $filename = $request->file->getClientOriginalName();
        $file = new File;
        $file = save();
        return 'yes';
    return $request->all();
public function showUploadForm()
    return view('vendorQuote_details');

my route is

Route::get('file','[email protected]')->name('upload.file');
Route::post('file','[email protected]');

Please sign in or create an account to participate in this conversation.