Hello,
here is a short snipper from my project:
My View:
PHP Code:
<?= form_open('user/upload_logo'); ?>
<input type="file" name="userfile" />
<br><p class="text-right">
<input type="submit" class="btn btn-primary" value="upload">
</p>
<?= form_close(); ?>
And on the Controller's side: (Just simple to check if getFiles() is working... )
PHP Code:
public function upload_logo()
{
$files = $this->request->getFiles();
var_dump($files);
}
Result is
array(0) { }
Even if I use getFile('userfile') and try validate, move, store, etc. it always returns an error that I am calling a function on null.
So my file is getting lost while uploading
Anyone know how to fix this?
BR,
Niklas