Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 897
Azima Avatar asked Jan 10 '18 17:01

Azima


2 Answers

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().

like image 144
ViliusL Avatar answered Sep 23 '22 17:09

ViliusL


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.

like image 37
Serdar D. Avatar answered Sep 25 '22 17:09

Serdar D.