Last active
September 21, 2015 14:13
-
-
Save sword-jin/0c2710e79edbd1874e52 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
if(Input::has('file')) { | |
$file = Input::file('file'); | |
return [ | |
'path' => $file->getRealPath(), | |
'size' => $file->getSize(), | |
'mime' => $file->getMimeType(), | |
'name' => $file->getClientOriginalName(), | |
'extension' => $file->geClientOriginalExtension() | |
]; | |
} |
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
if (Input::has('file')) { | |
$file = Input::('file'); | |
$name = time() . '-' . $file->getClientOriginalName(); | |
$file->move(public_path() . '/images/' . $name); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment