refactor FileUpload.php and Request.php