//附件上传
function upload(){
if(!empty($_FILES)){
//show_debug($_FILES);
$config = array(
'rootPath' => './Public/', //根目录
'savePath' => './upload/', //保存路径
);
//上传路径 ./根目录/保存路径
$upload = new Upload($config);
$re = $upload->uploadOne($_FILES['file']);
if(!$re){
//上传根目录不存在!请尝试手动创建:./Uploads/
show_debug($upload->getError());
}
}
} <!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
</head>
<body>
<form action="{$smarty.const.__MODULE__}/Emp/upload" enctype="multipart/form-data" method="post">
<input type="text" name="name">
<input type="file" name="file">
<input type="submit" value="提交">
</form>
</body>
</html>结果变成这样
问题已经解决 是我看结果的方法不对。
最佳答案