See amended file upload and code in post 6