api.putAttachment requires the data is of type buffer