Skip to content

Instantly share code, notes, and snippets.

@sword-jin
Last active September 21, 2015 14:13
Show Gist options
  • Save sword-jin/0c2710e79edbd1874e52 to your computer and use it in GitHub Desktop.
Save sword-jin/0c2710e79edbd1874e52 to your computer and use it in GitHub Desktop.
文件上传
if(Input::has('file')) {
$file = Input::file('file');
return [
'path' => $file->getRealPath(),
'size' => $file->getSize(),
'mime' => $file->getMimeType(),
'name' => $file->getClientOriginalName(),
'extension' => $file->geClientOriginalExtension()
];
}
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