Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attachments with special characters lost when uploaded from MS Teams #1392

Open
LuisM000 opened this issue Sep 24, 2024 · 7 comments
Open

Attachments with special characters lost when uploaded from MS Teams #1392

LuisM000 opened this issue Sep 24, 2024 · 7 comments
Assignees
Labels
bug Something isn't working

Comments

@LuisM000
Copy link

Background

This issue was previously reported in #6817 and #4750 in the BotBuilder repository but was closed as the problem seems to be related to Microsoft Teams, not the bot itself. I am reopening this issue here in the Microsoft-Teams-Samples repository, as it was suggested that the fix should be handled on this side.

Version

Lastest

Describe the bug

When I upload an attachment from Microsoft Teams with certain special characters, such as a '+', the attachment "disappears" when it is received in the bot's backend.

For example, uploading a file with a "normal" name like test.txt works as expected, and I receive the following in the bot's backend:

{
    "attachments": [
        {
            "contentType": "application/vnd.microsoft.teams.file.download.info",
            "content": {
                "downloadUrl": "https://ckm-my.sharepoint.com/personal/xxxxxx/_layouts/15/download.aspx?UniqueId=xxxxx-xxxx-xxxx-xxxx-xxxxx&Translate=false&tempauth=v1.xxxx.xxxx.xxxx&ApiVersion=2.0",
                "uniqueId": "xxxx-xxxx-xxxx-xxxx-xxxxx",
                "fileType": "txt"
            },
            "contentUrl": "https://ckm-my.sharepoint.com/personal/xxxxxx/Documents/Microsoft Teams Chat Files/test.txt",
            "name": "test.txt"
        },
        {
            "contentType": "text/html",
            "content": ""
        }
    ],
    "type": "message",
    "timestamp": "2024-07-11T10:29:11.4680572Z",
    "localTimestamp": "2024-07-11T12:29:11.4680572+02:00",
    "id": "1720693751445",
    "channelId": "msteams",
    // ....
}

However, if I upload a file with a name like test+.txt, I only receive the following:

{
    "attachments": [
        {
            "contentType": "text/html",
            "content": ""
        }
    ],
    "type": "message",
    "timestamp": "2024-07-11T10:36:45.0287287Z",
    "localTimestamp": "2024-07-11T12:36:45.0287287+02:00",
    "id": "1720694205007",
    "channelId": "msteams",
    //...
}

To Reproduce

Steps to reproduce the behavior:

  1. Use the basic example from BotBuilder-Samples.
  2. Upload a file with a normal name (e.g., test.txt) from Microsoft Teams.
  3. Observe the attachment received in the bot's backend.
  4. Upload a file with a special character in the name (e.g., test+.txt) from Microsoft Teams.
  5. Observe the attachment received in the bot's backend.

Expected behavior

Attachments with special characters in their names should be processed correctly and received in the bot's backend just like attachments with normal names.

Screenshots

N/A

@Nivedipa-MSFT
Copy link
Collaborator

Nivedipa-MSFT commented Sep 24, 2024

@LuisM000 - Thanks for reporting your issue. We are able to repro your issue. We have raised a bug for it and will let you know once we have any updates on it.

@Nivedipa-MSFT Nivedipa-MSFT self-assigned this Sep 25, 2024
@Nivedipa-MSFT Nivedipa-MSFT added the bug Something isn't working label Sep 25, 2024
@LuisM000
Copy link
Author

LuisM000 commented Oct 2, 2024

Any updates :)?

@Nivedipa-MSFT
Copy link
Collaborator

@LuisM000 - We are checking the status of the bug with the engineering team. We will let you know once we get any updates from them.

@gazambuja
Copy link

gazambuja commented Oct 18, 2024

Same problem here, but the file name do not have any special character, and comes from a sharepoint folder:

Screenshot from 2024-10-18 11 04 06

When I see the request that Teams send to the bot, no "attachment" objects come:

{
    "text": "test this file",
    "textFormat": "plain",
    "attachments": [
        {
            "contentType": "text/html",
            "content": "<p>test this file</p>"
        }
    ],
    "type": "message",
    "timestamp": "2024-10-18T14:03:21.2949396Z",
    "localTimestamp": "2024-10-18T11:03:21.2949396-03:00",
    "id": "1729260201268",
    "channelId": "msteams",
    "serviceUrl": "https://smba.trafficmanager.net/amer/",
    "from": {
        "id": "xxxxx",
        "name": "xxxxx",
        "aadObjectId": "xxxxx"
    },
    "conversation": {
        "conversationType": "personal",
        "tenantId": "xxxxx",
        "id": "xxxxxx"
    },
    "recipient": {
        "id": "xxxxxx",
        "name": "xxxxxx"
    },
    "entities": [
        {
            "locale": "en-US",
            "country": "US",
            "platform": "Mac",
            "timezone": "xxxxxx",
            "type": "clientInfo"
        }
    ],
    "channelData": {
        "tenant": {
            "id": "xxxxxx"
        }
    },
    "locale": "en-US",
    "localTimezone": "xxxxxx"
}

@rliberoff
Copy link

Hello, It has been almost two months since this has been reported.

Is there any update?

This is becoming a huge issue for Copilot initiatives using Teams as a communication channel.

Please help!!! 😥😥😥

@Nivedipa-MSFT
Copy link
Collaborator

@rliberoff - Thank you for your inquiry regarding the status of the bug. We are currently checking in with the engineering team for any updates.
We appreciate your patience and will inform you as soon as we have more information.
Thank you!

@marsanga
Copy link

Hello! Any news on this front? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants