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.
It also happens if your php.ini
has wrong upload_tmp_dir
path.
p.s. it may not be possible to disable it with error_reporting()
.
Be sure that the directory you want to save something is writeable.
For example, in my case, it was a Concrete 5 directory that has to be writeable. After I change permission to 777 it stopped crying.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With