問題描述
我只是使用 html 表單上傳文件.
I'm simply using a html form to upload a file.
但我收到以下錯(cuò)誤:
注意:未知:在系統(tǒng)臨時(shí)目錄中創(chuàng)建的文件第 0 行未知
Notice: Unknown: file created in the system's temporary directory in Unknown on line 0
這是我的 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>
路線如下:
$f3->route('POST|PUT @CSVUpload: /CSVUpload', 'GBDInternalsControllersLeaveController->csvHandler');
$f3->route('GET /CSVUpload', 'GBDInternalsControllersLeaveController->csv');
這是我的控制器:
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.
我發(fā)現(xiàn)上傳的文件被臨時(shí)存儲(chǔ)到 upload_tmp_dir="C:inetpub emp"
.
I found out that uploaded files are temporarily stored to upload_tmp_dir="C:inetpub emp"
.
這里有什么問題??
非常感謝任何幫助.謝謝.
Any help is very much appreciated. Thanks.
推薦答案
這不是錯(cuò)誤,這是通知.請參閱此請求.基本上,它只是告訴你它已經(jīng)回退到系統(tǒng)的默認(rèn)臨時(shí)目錄,而不是你提供的更具體的東西.您可以將其覆蓋為更具體的內(nèi)容(例如專門針對此應(yīng)用的臨時(shí)目錄)或通過 error_reporting()
禁用通知.我推薦前者.
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.
這篇關(guān)于注意:Unknown:在系統(tǒng)臨時(shí)目錄下第 0 行 Unknown 中創(chuàng)建的文件的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!