public function file($name = '', $uploadDir = UPLOAD)
    {
        if (isset($_FILES[$name])) {
            $file = new FileUpload($_FILES[$name], $uploadDir);
            return $file;
        } else {
            throw new FileNotUploadedException(sprintf('Your %s file is not uploaded yet', $name));
        }
    }
public function file($name = '', $uploadDir = UPLOAD)
    {
        if (isset($_FILES[$name])) {
            $file = new FileUpload($_FILES[$name], $uploadDir);
            return $file;
        } else {
            throw new FileNotUploadedException(sprintf('Your %s file is not uploaded yet', $name));
        }
    }
public function file ( $ name = '' , $ uploadDir = UPLOAD ) { if ( isset ( $ _FILES [ $ name ] ) ) { $ file = new FileUpload ( $ _FILES [ $ name ] , $ uploadDir ) ; return $ file ; } else { throw new FileNotUploadedException ( sprintf ( 'Your %s file is not uploaded yet' , $ name ) ) ; } }
upload a file with input name and uplaod dir,

////////////////

$name parameter must be a string and it is has to be exists
$uploadDir         must be an instance of string and it's must be a dir.

@param string $name        the name of upload input
@param string $uploadDir   the dir to upload file
@throws FileNotUploadedException
@return FileUpload
upload a file with input name and uplaod dir