added method to upload buffer to s3