botframework-sdk: Bot unable to receive attached files in Teams
Bot Info
- SDK Platform: Node.js
- SDK Version: botbuilder 3.14.0
- Active Channels: MS Teams
- Deployment Environment: ngrok and test Team
Issue Description
I have my bot running in Teams, and when I click the paperclip to try to attach a text file (or any kind of file), the file doesn’t show up anywhere in the message that the bot receives. But when I copy/paste an image into the message text, it shows up in the bot’s session.message.attachments. Is there a way for the bot to receive text files?
Code Example
bot.dialog('/', function(session, args) {
var msg = session.msg;
console.log(msg.attachments);
session.endDialog();
}
Reproduction Steps
- Attach file using paperclip in Teams
- @-mention bot and send message
Expected Behavior
File appears in msg.attachments
Actual Results
File does not appear in msg.attachments, but Mention of bot does.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 21 (1 by maintainers)
@ajayputti The manifest must have
'supportsFiles': true
as demonstrated in this sample: https://github.com/microsoft/BotBuilder-Samples/blob/master/samples/csharp_dotnetcore/56.teams-file-upload/TeamsAppManifest/manifest.json#L32@schmollycule Ok. Found this tidbit on Stack Overflow regarding Bot Framework and receiving files… per Bill Bliss (MSFT) in his answer (not yet accepted by the asker, but provided below):
So it appears you cannot attach text files and send to a Teams bot at this time.
In my tests, even attaching a PNG from my own computer did not attach either (group channel chat), but using the GIF button and selecting from Giphy transmitted the image. Which doesn’t help with uploading other documents. The GIF transmitted and was recognized in both channel and one-on-one in this test.
@andyroz It would appear Android, based on the same Stack Overflow question, will only send image files. I was not able to see a PNG image I attempted to attach on the Windows desktop or the web version of Teams in a group channel, and the aforementioned versions do not provide for a file upload in a one-on-one environment (as there is no paperclip button in the one-on-one chats in those versions).
Not the answer we hoped for, but this appears to be the case.
As there does not appear to be a desired resolution at this time based on the given information, I will be closing this issue. Feel free to reopen or open a new question if there are any other issues. Thank you both for your patience as I worked through this.
I’m using Teams in the web app in Chrome on Ubuntu