BotBuilder-Samples icon indicating copy to clipboard operation
BotBuilder-Samples copied to clipboard

use encoding : null to download binary content

Open ebrulato opened this issue 10 years ago • 2 comments

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,

ebrulato avatar Sep 30 '16 07:09 ebrulato

Hi @ebrulato ! PR #11 has been created to address the issue. Thank you for reporting it!

pcostantini avatar Sep 30 '16 14:09 pcostantini

closing this issue, since it has been addressed by the PR. Thanks for reporting it!

Andrea-Orimoto avatar Sep 30 '16 22:09 Andrea-Orimoto