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

你。 提交于 2019-12-10 21:21:26

问题


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.


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/48192705/notice-unknown-file-created-in-the-systems-temporary-directory-in-unknown-on

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!