Modify the upload file function.