every time occur this error even we have set the enctype="multipart/form-data"
Someone, Please help me to resolve this issue.
we are posting our form and controller below.
Please help me to resolve
====Form ==========
<form method="request" action="pupload" enctype="multipart/form-data">
@csrf
<input type="file" name="userfile" id="userfile" class="form-control">
<br>
<button type="submit" class="btn btn-primary">Submit</button>
</form>
======controller =====
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class PracticeController extends Controller
{
function index(){
return view('form');
}
function upload(Request $request){
$path=$request->file('userfile')->store('public');
if($path){
return "file uploaded successfully";
}
}
}
===Route===
<?php
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\PracticeController;
Route::get('/', function () {
return view('welcome');
});
Route::get('practice',[PracticeController::class,'index']);
Route::get('pupload',[PracticeController::class,'upload']);
What I have tried:
Someone , Please help me to resolve this error.
I'll be very thankfull for this kind act