Laravel 4.2laravel 4.2文件上傳問題
我的代碼 -
圖像upload.blade.php
<html>
<head>
<meta charset="utf-8">
<title>Image Upload</title>
</head>
<body>
<h1>Upload Files here</h1>
<form enctype="multipart/form-data" method="post" action="{{ @url('image-handle') }}">
<input type="file" name="image" id="avatarImage" />
<input type='hidden' name='_token' value='{{ @csrf_token() }}' />
<input type="submit" name="submit">
</body>
</html>
路線 -
Route::get('image-upload', function()
{
return View::make('image-upload');
});
Route::get('image-handle', function()
{
return Input:: file('image') -> getFileName();
});
所有我想要做的是var_dump該文件提交後,但不幸的是我得到的是「哎呀,看起來像出了什麼問題」。
如何解決這個問題,並在laravel 4.2成功上傳圖片?
在此先感謝!
你可以添加糾正碼嗎? –