I’m using BotFramework in C#. The issue I’m encountering is that when I upload an attachment from Teams with certain characters, such as a ‘+’, the attachment “disappears” when received in the bot’s backend.
For example, if I upload a file with a “normal” name like test.txt, I receive this in the bot’s backend:
{
"attachments": [
{
"contentType": "application/vnd.microsoft.teams.file.download.info",
"content": {
"downloadUrl": "https://ckm-my.sharepoint.com/personal/xxxxxx/_layouts/15/download.aspx?UniqueId=xxxxx-xxxx-xxxx-xxxx-xxxxx&Translate=false&tempauth=v1.xxxx.xxxx.xxxx&ApiVersion=2.0",
"uniqueId": "xxxx-xxxx-xxxx-xxxx-xxxxx",
"fileType": "txt"
},
"contentUrl": "https://ckm-my.sharepoint.com/personal/xxxxxx/Documents/Microsoft Teams Chat Files/test.txt",
"name": "test.txt"
},
{
"contentType": "text/html",
"content": ""
}
],
"type": "message",
"timestamp": "2024-07-11T10:29:11.4680572Z",
"localTimestamp": "2024-07-11T12:29:11.4680572+02:00",
"id": "1720693751445",
"channelId": "msteams",
// ....
}
However, if I upload a file with a name like test+.txt, I receive only this:
{
"attachments": [
{
"contentType": "text/html",
"content": ""
}
],
"type": "message",
"timestamp": "2024-07-11T10:36:45.0287287Z",
"localTimestamp": "2024-07-11T12:36:45.0287287+02:00",
"id": "1720694205007",
"channelId": "msteams",
//...
}
This issue occurs with the basic example from BotBuilder-Samples (https://github.com/microsoft/BotBuilder-Samples/tree/main/samples/csharp_dotnetcore/15.handling-attachments).
It seems attachments with certain characters in their names are not being processed correctly. Any insights on how to handle this would be greatly appreciated.