I have been trying to upload images from a form with putFileAs but so far I have not been able to complete the task
I have read that I need to use enctype="multipart/form-data" in the form and I have done it
<form method="POST" action="/blog" enctype="multipart/form-data">
@csrf
<div class="field">
<label class="label col-lg-4" for="header_img">Imagen principal</label>
<div class="control">
<input class="input col-lg-8 @error('header_img') is-danger @enderror" type="file" name="header_img" id="header_img">
@error('header_img')
<p class="help is-danger">{{ $message }}</p>
@enderror
</div>
</div>
<div class="field col-lg-4 col-lg-push-10">
<div class="control">
<button class="button1" type="submit">Crear</button>
</div>
</div>
</form>
On the controller side, I am getting the image, defining a folder to save the image, selecting the disk and passing this information to putFileAs
$file = Storage::disk($disk)->putFileAs($folder, $uploadedFile, $name.'.'.$uploadedFile->getClientOriginalExtension());
I have also logged the variable values
$disk = public
$folder = /images/articles
$uploadedFile = C:\ProjectPath\php60C2.tmp
$name = 1597289384
I have also logged $file and this is the output:
images/articles/1597289384.jpg
But the file is never stored in images/articles folder, I have also searched in all the folders of the project but the file was never uploaded
Could someone help me to understand why the file is being not stored?
Thank you in advance
Have a good day