Writing files to an AWS S3 instance