added redirect functionality to upload.php