Commit ee4dd5e9 authored by Taylor Otwell's avatar Taylor Otwell

tweaked File::upload.

parent 65056383
...@@ -187,14 +187,19 @@ class File { ...@@ -187,14 +187,19 @@ class File {
} }
/** /**
* Move uploaded file, Use $_FILES['file'] for $file * Move an uploaded file to storage.
* *
* @param array $file * @param string $key
* @param string $path * @param string $path
* @return bool * @return bool
*/ */
public static function upload($file, $path) public static function upload($key, $path)
{ {
return ( ! move_uploaded_file($file['tmp_name'], $path)) ? false : true; if ( ! array_key_exists($key, $_FILES))
{
return false;
}
return move_uploaded_file($_FILES[$key]['tmp_name'], $path);
} }
} }
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment