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

File attachments for PDF produce turnError: Unknown attachment type #4845

Open
ruben-vb opened this issue Jan 16, 2025 · 2 comments
Open

File attachments for PDF produce turnError: Unknown attachment type #4845

ruben-vb opened this issue Jan 16, 2025 · 2 comments
Assignees
Labels
bug Indicates an unexpected problem or an unintended behavior. needs-triage The issue has just been created and it has not been reviewed by the team.

Comments

@ruben-vb
Copy link

ruben-vb commented Jan 16, 2025

Github issues should be used for bugs and feature requests. Use Stack Overflow for general "how-to" questions.

Versions

version 4.23.1, node 18

Describe the bug

issue in botbuilder-samples

As described here. It shows the same error for a base64 encoded file aswell as one provided using a url like so:

        const reply = { type: ActivityTypes.Message };

        reply.text = 'This is an inline attachment.';
        reply.attachments = [{
            name: 'dummy.pdf',
            contentType: 'application/pdf',
            contentUrl: 'https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf'
        }];

        await context.sendActivity(reply);

Produces the error:

[onTurnError] unhandled error: RestError: Unknown attachment type

To Reproduce

Install botbuilder and try to send the above pdf as an attachment or really any pdf.

Expected behavior

PDF attached as a downloadable file

Additional context

The samples only provide examples for images. According to the documentation, other file formats which are not images/video/audio should also be possible even though there are no examples for them.

Also existed in version 4.20.0, but updating didn't fix it.

@ruben-vb ruben-vb added bug Indicates an unexpected problem or an unintended behavior. needs-triage The issue has just been created and it has not been reviewed by the team. labels Jan 16, 2025
@stevkan stevkan self-assigned this Jan 16, 2025
@stevkan
Copy link
Collaborator

stevkan commented Jan 16, 2025

@ruben-vb

Which client is the user communicating with the bot with? Web Chat, Teams, Slack, something else?
I'm assuming, from the bit of included code, that the user is making a request for a file and the bot is then responding with the attached file, correct?

@ruben-vb
Copy link
Author

@stevkan

The client is Teams. Kind of yeah, it's a RAG system with the possibility of images or other attachments being relevant to the answer. Attaching images (as additional attachments as above but also with the adaptive cards definition) works fine but as soon as I have 'application/pdf' as contentType its producing the error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or an unintended behavior. needs-triage The issue has just been created and it has not been reviewed by the team.
Projects
None yet
Development

No branches or pull requests

2 participants