<!DOCTYPE html>
<html lang="zh-CN">
<head>
{{--设置字符编码--}}
<meta charset="utf-8">
{{--作者--}}
<meta name="author">
{{--给搜索引擎提供的,页面详情--}}
<meta name="description" content="">
{{--标题--}}
<title>文件上传测试</title>
</head>
<body>
<form action="index.php/upload" method="post" enctype="multipart/form-data">
{{ csrf_field() }}
<input type="file" name="meinv">
<input type="submit" value="上传">
</form>
</body>
</html>
-----------------------------------------------------
----------------
<?php
namespace AppHttpControllers;
use IlluminateHttpRequest;
use AppHttpRequests;
use AppHttpControllersController;
use Auth;
use DB;
/**
*
*/
class IndexController extends Controller
{
public function index(){
$cate = 'dengshipeng';
return view('viewhome.index',['cate'=>$cate]);
}
public function upload(Request $request){
$request->file('meinv')->store('meinv');
exit;
return view('viewhome.index');
}
}
?>
--------------------------------