Add support of attachments by adding config parameter sendAttachment.  When it is true, the parameter doc_size is used for attachment size.