Fixed upload bug that accepted any file path for upload. Added input validation and error message for invalid file paths.