File downloading is getting failed in MS Teams Bot (Desktop and Web) using File consent card.
Version
Bot Framework SDK 4.8.1 Microsoft.Bot. Schema version 4.8.0
Describe the bug
-
File downloading is failing in MS Teams Bot (Desktop and Web) whereas files are properly getting uploaded in Users OneDrive.
-
We are using a File Consent Card to upload the file in the User’s OneDrive. And once, the file is uploaded in OneDrive, Bot brings back the option to download the document locally in the MS Teams BOT. After clicking on 3 Dots > Download > it is showing “The File Didn’t Download”
Code Snippet for file consent card : string filename = fileName + "." + fileExtension;
long filesize = Convert.ToInt64(result);
var consentContext = new Dictionary<string, string>
{
{ "filename", filename }
};
var fileCard = new FileConsentCard
{
Description = "This is the file I want to send you",
SizeInBytes = filesize,
AcceptContext = consentContext,
DeclineContext = consentContext
};
var asAttachment = new Microsoft.Bot.Schema.Attachment
{
Content = fileCard,
ContentType = FileConsentCard.ContentType,
Name = filename,
};
attachment.ContentData = fileCard;
attachment.ContentType = FileConsentCard.ContentType;
attachment.Text = filename;
Screenshots
Please find the screenshots,



Hi - Its hard to tell what is going wrong from the code snippet above. Have you taken a look at our complete file upload sample here - https://github.com/microsoft/BotBuilder-Samples/blob/main/samples/csharp_dotnetcore/56.teams-file-upload/Bots/TeamsFileUploadBot.cs ? That shows the entire flow, including creating the download card in the FileUploadCompletedAsync method.
@RajdeepRay0411 Have you gone through TeamsFilsUploadBot sample, are you still facing the issue.
Hi @clearab and @Chetana-MSFT: I had gone through the documents you have shared. I am using the same thing but still, the same issue is coming. Can you please let us know if there have been some changes from the MS side for file uploading and downloading in the latest app updates.
Hi @RajdeepRay0411 I am able repro the issue, we have raised a bug for this, concerned engineering team is working on it.