Fixed upload file, cleaned up

Added extra error checking
Upload files now match documentation