emulate upload and retrieve script