upload.sh: added some sanity checks