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

There is an issue with attaching files inside the bot for the user #4034

Open
Mohammadhiasat opened this issue Feb 5, 2025 · 2 comments
Open
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

@Mohammadhiasat
Copy link

code of attachment:

def create_file_attachment(self, file_path):
with open(file_path, "rb") as file_stream:
file_data = file_stream.read()
attachment = Attachment(
name=os.path.basename(file_path),
content_type="application/octet-stream",
content=file_data
)
return attachment

problem:

# the bot will send a docx file as an attachment to the user 
# but the attachment can't be downloaded by the user in the emulator(download button is not available)

Image

Image

needs:

the attachment can be downloaded by the user in the emulator
@Mohammadhiasat Mohammadhiasat 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 Feb 5, 2025
@stevkan stevkan self-assigned this Feb 6, 2025
@stevkan
Copy link
Collaborator

stevkan commented Feb 6, 2025

Can you tell me which version of Emulator it is that you are using?

Also, this looks like the bot is built with botbuilder-python. Is this correct? If so, can you tell me which version of that you are using? Can you include all the relevant code for the activity being sent that included the attachment so I can try and repro this?

@Mohammadhiasat
Copy link
Author

Hello, how are you? I am using version 4. And yes, that's correct, the bot is built using Bot Builder Python. Yes, of course, I will send you the part that includes the attachment code.

code of attachment:
def create_file_attachment(self, file_path):
with open(file_path, "rb") as file_stream:
file_data = file_stream.read()
attachment = Attachment(
name=os.path.basename(file_path),
content_type="application/octet-stream",
content=file_data
)
return attachment

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