I would like to respond to a conversation by providing a barcode (.PNG) that has been base64 encoded. Is that possible? Or is the only method of delivery thru a Url.
Asked
Active
Viewed 6,033 times
1
-
IMO, this is a better answer: http://stackoverflow.com/a/38252182 – Oct 17 '16 at 23:52
-
IMO, this is a better answer: http://stackoverflow.com/a/38252182 – Oct 17 '16 at 23:52
1 Answers
3
Try:
replyMessage.Attachments.Add(new Attachment()
{
ContentUrl = $"data:image/jpeg;base64,{Convert.ToBase64String(bdata)}"
});
Or as JSON:
{
"attachments":
[
{
"contentUrl": $"data:image/jpeg;base64,{Convert.ToBase64String(bdata)}"
}
]
}
Where bdata is a byte array

Lars
- 9,976
- 4
- 34
- 40