use encoding : null to download binary content
Hi,
Thanks for the code sample BotBuilder-Samples/Node/core-ReceiveAttachment/app.js. But I've found an issue: the download of binary content requires to set encoding with a null value see http://stackoverflow.com/questions/14855015/getting-binary-content-in-node-js-using-request for more details and https://github.com/request/request (search encoding: null)
I suggest this fix
var requestWithToken = function (url, contentType, token) { return request({ url: url, encoding : null, headers: { 'Authorization': 'Bearer ' + token, 'Content-Type': contentType } }); };
// for other case var requestSimple = function (url, contentType) { return request({ url: url, encoding : null, headers: { 'Content-Type': contentType } }); };
best regards,
Hi @ebrulato ! PR #11 has been created to address the issue. Thank you for reporting it!
closing this issue, since it has been addressed by the PR. Thanks for reporting it!