Check for $newName in upload()

Repair functionality of setName() when uploading