getFiles() public method

get item from files
Since: 3.0.0
public getFiles ( string $key = null ) : string
$key string key of the item
return string
Example #1
0
 /**
  * upload
  *
  * @since 3.0.0
  */
 protected static function _upload()
 {
     $filesArray = current(Request::getFiles());
     /* upload file */
     if (is_uploaded_file($filesArray['tmp_name'])) {
         if (move_uploaded_file($filesArray['tmp_name'], self::$_configArray['uploadDirectory'] . '/' . $filesArray['name'])) {
             return json_encode(['location' => self::$_configArray['uploadDirectory'] . '/' . $filesArray['name']]);
         }
     }
     header('http/1.0 404 not found');
 }