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

sendAttachment error #97

Closed
frwebdev opened this issue Nov 2, 2022 · 2 comments
Closed

sendAttachment error #97

frwebdev opened this issue Nov 2, 2022 · 2 comments

Comments

@frwebdev
Copy link

frwebdev commented Nov 2, 2022

I have a problem with the method in question > chatSession.sendAttachment()
This is what is reported in the documentation:

attachment object is the actual file that will be sent to agent from end-customer and vice versa.

const awsSdkResponse = await chatSession.sendAttachment({
  attachment: attachment
})

I tried to send the attachment both as a File and as a Blob type.
In both cases I get this error

TypeError: Cannot read properties of undefined (reading 'type')

I have noticed that the documentation is quite vague about the attachments.

Has anyone used the method successfully and can you help me?

@haomingli2020
Copy link
Collaborator

haomingli2020 commented Nov 21, 2022

Hi there,

You can refer to the sendAttachment() and onFileInput() functions in this file from another repo.
Which basically takes in the file input when user uploads it and eventually calls the same chatSession.sendAttachment() in this repo - ref.

@frwebdev
Copy link
Author

Thank you, the problem was i didn't send attachment like an object with the right key "attachment".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants