Correctly writes export file to s3 using file stream buffers.