<?php
namespace Home\Controller;
use Think\Controller;
class IndexController extends Controller {
//提交页面
public function index(){
$this->display();
}
//文件提交处理
public function form(){
$config = array(
'rootPath' => './Uploads/',
);
$upload = new \Think\Upload($config);
$info = $upload->uploadOne($_FILES['file']);
if(!$info){
echo $upload->getError();
}
}
}<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>
<body>
<form action="__URL__/form" enctype="multipart/form-data" method="post">
<input type="file" name="file" />
<input type="submit"/>
</form>
</body>
</html>页面显示页面错误!请稍后再试~
ThinkPHP3.2.2 { Fast & Simple OOP PHP fr
thinkphp 3.21 关闭调试后,new \Think\Upload()全部不行了
请教是什么原因导致的
最佳答案