Created
November 27, 2017 13:15
-
-
Save flayder/a3ceb1a144887e7e6bf4ede8730c8b3f to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class UploadFileController extends Controller { | |
public function index() { | |
return view('uploadfile') ; | |
} | |
public function showUploadFile(Request $request) { | |
$file = $request->file('image') ; | |
//Display File Name | |
echo 'File Name: '.$file->getClientOriginalName() ; | |
echo '<br>'; | |
//Display File Extension | |
echo 'File Extension: '.$file->getClientOriginalExtension() ; | |
echo '<br>'; | |
//Display File Real Path | |
echo 'File Real Path: '.$file->getRealPath() ; | |
echo '<br>'; | |
//Display File Size | |
echo 'File Size: '.$file->getSize() ; | |
echo '<br>'; | |
//Display File Mime Type | |
echo 'File Mime Type: '.$file->getMimeType() ; | |
//Move Uploaded File | |
$destinationPath = 'uploads'; | |
$file->move($destinationPath,$file->getClientOriginalName() ); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment