Tweak upload method in file class.
This commit is contained in:
parent
1ed1fdf6fc
commit
bbc8a5d0d0
|
@ -108,14 +108,13 @@ public static function modified($path)
|
||||||
*
|
*
|
||||||
* @param string $key
|
* @param string $key
|
||||||
* @param string $path
|
* @param string $path
|
||||||
* @param array $files
|
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public static function upload($key, $path, $files = null)
|
public static function upload($key, $path)
|
||||||
{
|
{
|
||||||
if (is_null($files)) $files = $_FILES;
|
if ( ! isset($_FILES[$key])) return false;
|
||||||
|
|
||||||
return move_uploaded_file($files[$key]['tmp_name'], $path);
|
return move_uploaded_file($_FILES[$key]['tmp_name'], $path);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue