-
Notifications
You must be signed in to change notification settings - Fork 16
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
Add example for sending media #231
Comments
Hi @nikoksr, Some references that I used for those types: From what I could tell the expectation is (as you noted) that the content be uploaded somewhere else and then referenced as a URL. If you learn differently please share as that could benefit others also. |
Hi @atc0005, Thanks for providing the references. Based on my understanding, it seems that the current expectation for content in the library is to upload it somewhere else and then reference it as a URL. However, I come from a background where I'm used to providing attachments as a byte slice or For instance, in the Slack service, I can pass a reader that streams the local file into the upload parameters, as shown in this example: params := slack.UploadFileV2Parameters{
Channel: channelID,
Reader: attachment.Reader(),
Filename: attachment.Name(),
FileSize: int(attachment.Size()),
AltTxt: attachment.Name(),
}
if _, err := s.client.UploadFileV2Context(ctx, params); err != nil {
return err
} All other services that support file uploads have similar functionality. Just to be clear, not pointing fingers at your library here at all; It seems that this issue is related to the API rather than your library. I'm simply looking for clarification to ensure that my understanding is correct. Thank you for your help! |
Oh, I don't take offense. There is a lot to be improved here. Feedback is welcome.
That is my understanding as well. I've not worked with attachments myself, only stubbed out what support there currently is for them (going from memory it probably isn't much). |
Hi, notify author here. We're currently working on a
v2
and I'm interested in uploading/sending files in the form of a message attachment to Teams.I've worked my way through the code and I see things like the attachment type, image elements and media elements. Using, for example, an image element and adding it as a card to an existing adaptive card, seems straight forward. However, it expects an URL, implying that the image has to have been uploaded somewhere before. The functionality we're aiming for and that most other services (so far) support, is uploading a local file as a message attachment. Is there a way to do this, that I'm overlooking?
Secondly, is there a way to upload non-image type files? Most other platforms support a way to upload a file of arbitrary type. I'd assume that this is done via the media type but the comment suggests, that this may not be functional with Teams. I'd appreciate if you could clarify this for me.
The text was updated successfully, but these errors were encountered: