Search code examples
botframeworkmicrosoft-teamsdirect-line-botframework

Using azure bot services in Teams : how to send files to bot


I am new to development in teams and bot framework.

I have a botframework bot which is up and running on Teams. I did not use the app studio, I directly exported it from azure bot service.

I want to send an image from the mobile phone (like a selfie). It seems you can do this with any contact you have but not with bots. Right now, sending files to bots seems to be impossible on my version of Teams. You can send an image via bing, that's all.

enter image description here

From the documentation below, it says: "Sending and receiving files to bots on mobile devices is not supported." https://learn.microsoft.com/en-us/microsoftteams/platform/bots/how-to/conversations/send-and-receive-files?tabs=dotnet On my computer, it seems as well that it is not supported. Anyway, I am looking for a solution to use my phone camera to share a selfie.

I came across this thread that discusses a way to add a button to prompt the user to upload a file on the client-side. Prompt User to Upload file in Dialog Flow with MS Bot Framwork v4

Is this possible to do this in Teams rather than on Webchat?

I am new to this framework, so any insights on the above would be greatly appreciated!


Solution

  • This is possible and we actually just released a sample for it (Node / C#). Note, however, that I don't believe you can trigger the user's camera...only ask for them to upload an image file.

    The important part that you're likely missing is step 7 (you need a manifest.json that contains "supportsFiles": true):

    This step is specific to Teams. Edit the manifest.json contained in the teamsAppManifest folder to replace your app id from Bot Framework everywhere you see the place holder string <>. Zip up the contents of the teamsAppManifest folder to create a manifest.zip. Upload the manifest.zip to Teams (in the Apps view click "Upload a custom app")