diff --git a/src/jio/commands/command.js b/src/jio/commands/command.js index 0c3a65f007700e56ccfe4ab68ebb49476715db1e..50c8bec3f6e296d75d5d46e063b3c120f4a59a12 100644 --- a/src/jio/commands/command.js +++ b/src/jio/commands/command.js @@ -96,6 +96,42 @@ var command = function(spec, my) { return priv.doc; }; + /** + * Returns the data of the attachment + * @method getAttachmentData + * @return {string} The data + */ + that.getAttachmentData = function () { + return priv.doc._data; + }; + + /** + * Returns the data length of the attachment + * @method getAttachmentLength + * @return {number} The length + */ + that.getAttachmentLength = function () { + return priv.doc._data.length; + }; + + /** + * Returns the mimetype of the attachment + * @method getAttachmentMimeType + * @return {string} The mimetype + */ + that.getAttachmentMimeType = function () { + return priv.doc._mimetype; + }; + + /** + * Generate the md5sum of the attachment data + * @method md5SumAttachmentData + * @return {string} The md5sum + */ + that.md5SumAttachmentData = function () { + return hex_md5(priv.doc._data); + }; + /** * Returns an information about the document. * @method getDocInfo