Replacing rename with copy method when uploading a file.