FileConsentCard's Descripton property has no way to escape the ampersand character.
See original GitHub issueGithub issues should be used for bugs and feature requests. Use Stack Overflow for general “how-to” questions.
Version
4.15.0
Describe the bug
On a FileConsentCard, it does not appear to be possible to use an unescaped ampersand in the Description property. The same issue seems to be present on the Attachment name.
To Reproduce
The following code is used to generate a FileConsentCard for the user to either accept or decline a file. The file name contains an ampersand which is not formatted correctly.
var consentContext = new Dictionary<string, string>
{
{ "blobId", blob.BlobId },
{ "filename", blob.FileName },
{ "messageString", blob.Message }
};
var fileCard = new FileConsentCard
{
Description = "P<est.xlsx",
SizeInBytes = blob.FileLength,
AcceptContext = consentContext,
DeclineContext = consentContext
};
var asAttachment = new Attachment
{
Content = fileCard,
ContentType = FileConsentCard.ContentType,
Name = "P<est.xlsx",
};
replyActivity.Attachments.Add(asAttachment);
await turnContext.SendActivitiesAsync(activities.ToArray(), cancellationToken);
The above produces the following file consent card.
Clicking the allow button successfully distributes the file, but the name is changed so it cannot be opened in the default app, Excel in this case.
I have tried to escape the ampersand with & and with %26 without success.
Expected behavior
File should appear with the ampersand in place as it was set on the Description for FileConsentCard and the Name for an Attachment.
Issue Analytics
- State:
- Created 2 years ago
- Comments:19 (11 by maintainers)
Top GitHub Comments
We are able to repro this issue, we are raising a bug for the same. We will update you.
@Meghana-MSFT - it looks like the file is displaying properly when it is delivered…
…but the preview seems to fail…
If I download the file, it removes the ampersand and any text after in the name. However, if I rename the file locally and add the extension, I am able to open it successfully.
Thanks,
Matt