I'm simply using a html form to upload a file.
But I'm getting below error:
Notice: Unknown: file created in the system's temporary directory in Unknown on line 0
Here's my HTML:
<form name="import" method="post" action="CSVUpload" enctype="multipart/form-data">
<input type="file" name="file" /><br />
<input type="submit" name="submit" value="Submit" />
</form>
Here's the route:
$f3->route('POST|PUT @CSVUpload: /CSVUpload', 'GBD\Internals\Controllers\LeaveController->csvHandler');
$f3->route('GET /CSVUpload', 'GBD\Internals\Controllers\LeaveController->csv');
Here's my controller:
public function csv()
{
$this->f3->set('content', 'leave/csvUploader.php');
$template = new \View;
echo $template->render('dashboard/layout.php');
}
public function csvHandler()
{
$postvalue = $this->f3->get('POST.submit');
if(isset($postvalue))
{
$fileReceived = $this->f3->get('POST.file');
var_dump($fileReceived);
}
}
I am using fat-free framework.
I found out that uploaded files are temporarily stored to upload_tmp_dir="C:\inetpub\temp"
.
What is wrong here??
Any help is very much appreciated. Thanks.