phphtmlfile-uploadfat-free-framework

Notice: Unknown: file created in the system's temporary directory in Unknown on line 0


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.


Solution

  • This is not an error, this is a notice. See this request. Basically, it's just telling you that it has fallen back to the system's default temp dir, as opposed to something more specific that you have provided. You can override it to something more specific (like a temp dir specifically for this app) or disable notices via error_reporting(). I'd recommend the former.