Question: i want to insert link of an image into a field in the database like annonces\August2020\image.jpg in storage, but it gives me error:`The POST method is not supported for this route. Supported methods: GET, HEAD`.

**file.blade.php**

```
<form action="/file" method="post" enctype="multipart/form-data">
                @csrf
                <div class="form-group">
                    <input type="file" class="form-control-file" name="file" id="file" aria-describedby="fileHelp">
                    <small id="fileHelp" class="form-text text-muted">Please upload a valid image file. Size of image should not be more than 2MB.</small>
                </div>
                <button type="submit" class="btn btn-primary">Submit</button>
            </form>

```

**web.php**

```
Route::get('file', 'fileController@index');
Route::get('save', 'fileController@save');

```

**FileController.php**

```
 public function save()
    {
       request()->validate(['file'  => 'required|mimes:doc,docx,pdf,txt|max:2048',]);
       if ($files = $request->file('fileUpload')) {
           $destinationPath = 'public/file/'; // upload path
           $profilefile = date('YmdHis') . "." . $files->getClientOriginalExtension();
           $files->move($destinationPath, $profilefile);
           $insert['file'] = "$profilefile";
        }
        $check = Document::insertGetId($insert);
        return Redirect::to("file")
        ->withSuccess('Great! file has been successfully uploaded.');
    }

```

Answer: 
as the error said, you need to declare the route as POST

```php
Route::post('save', 'fileController@save');

```

Also, put the correct route into the form action attribute

```
<form action="/save" method="post" enctype="multipart/form-data">

```
you are using **post** method in the form and then in the **web.php** you are using **get** method which is wrong.
in **We.php** use something like below:

```
Route::post('save', 'fileController@save');

```

Also please change the **action** attribute value to **save** which is a url in **web.php** because you are calling **save** method in the **Controller**

```
<form action="/save" method="post" enctype="multipart/form-data">

```