botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

File downloading is getting failed in MS Teams Bot (Desktop and Web) using File consent card.

Open RajdeepRay0411 opened this issue 4 years ago • 4 comments

Version

Bot Framework SDK 4.8.1 Microsoft.Bot. Schema version 4.8.0

Describe the bug

  1. File downloading is failing in MS Teams Bot (Desktop and Web) whereas files are properly getting uploaded in Users OneDrive.

  2. 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,

Picture1

Picture2

Picture3

RajdeepRay0411 avatar Jun 13 '21 08:06 RajdeepRay0411

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.

clearab avatar Jun 14 '21 18:06 clearab

@RajdeepRay0411 Have you gone through TeamsFilsUploadBot sample, are you still facing the issue.

Chetana-MSFT avatar Jun 16 '21 12:06 Chetana-MSFT

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.

RajdeepRay0411 avatar Jun 18 '21 08:06 RajdeepRay0411

Hi @RajdeepRay0411 I am able repro the issue, we have raised a bug for this, concerned engineering team is working on it.

Chetana-MSFT avatar Jun 22 '21 05:06 Chetana-MSFT