I have a problem uploading a file in my form using CodeIgniter 4 and I can't find what's wrong. Can you help me, please? The name of the file is ok, the problem is that it doesn't move the file in the specified directory because I get this error: Call to a member function move() on null. WRITEPATH has the value: C:\xampp\htdocs\myproject\writable\
The part of the view where I upload looks like this :
<div class="card-body">
<label for="exampleInputFile">Fisier</label>
<div class="form-group">
<div class="input-group">
<div class="custom-file">
<input type="file" class="custom-file-input" name="customFile" id="customFile" required>
<label class="custom-file-label" for="exampleInputFile">Alege Fisierul</label>
</div>
</div>
</div>
</div>
And the part of the controller function where I try to move the file in a specific folder looks like this :
$img = $this->request->getFile('customFile');
$img->move(WRITEPATH . 'uploads');
I take the name of the file with this : $this->request->getVar('customFile')
Thank you !