Updated upload to use the getVar/getPostVar functions