added code to delete the file after successful transmission to S3