Revised upload.py