[Skype] Can't download an attachment which a user sends to the bot.
See original GitHub issueVersion
SDK 4.5.2
Description
I’m trying to download a video message the user sent to the bot and I get 500 without any error message. It happens when I call GetByteArrayAsync but GetTokenAsync works just fine and returns the token. On the other hand it works fine when I send a video file as a file attachment. Please let me know if you have any ideas on how to fix this.
I get 500 when I try to download this file for example: https://smba.trafficmanager.net/apis/v3/attachments/0-weu-d11-a7dd2f30f52f28e7c657bbffc81be9e5/views/original
public async Task<byte[]> LoadAttachmentAsBytes(Attachment att, string serviceUrl)
{
var credentials = new MicrosoftAppCredentials("appId", "password");
using (var connectorClient = new ConnectorClient(new Uri(serviceUrl), credentials))
{
var token = await credentials.GetTokenAsync();
var uri = new Uri(att.ContentUrl);
using (var httpClient = new HttpClient())
{
httpClient.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
httpClient.DefaultRequestHeaders.Accept.Add(new MediaTypeWithQualityHeaderValue("application/octet-stream"));
return await httpClient.GetByteArrayAsync(uri);
}
}
}
Issue Analytics
- State:
- Created 4 years ago
- Comments:6
Top Results From Across the Web
C# Skype Bot download attachment
I am developing a Skype bot in C# with Bot Framework and I would like to download the attachment sent by the users,...
Read more >I am unable to download or save any attachments from my ...
I am unable to download or save any attachments from my Skype - Microsoft Community.
Read more >Troubleshooting problems sending or receiving files using ...
If you're having trouble sending or receiving a file that's been sent to you, chances are it's just a slow connection or bandwidth...
Read more >The Upgrade Utility appears to stop responding
The Windows Task Manager indicates that the Service Manager client is not responding. The Upgrade Utility doesn't show the progress after you ...
Read more >Skype
The Skype modules enable you to monitor events, or send a message and download an attachment in your Skype account. Getting Started With...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@dmvtech It reproduces when I send a video message in skype. Looks like I’m not only one who is facing this problem https://social.msdn.microsoft.com/Forums/officeocs/en-US/cf97950f-7af6-4ed4-a053-d3453198c090/500-server-error-while-downloadning-file-from-skype?forum=AzureCognitiveService
Closing this. Please let us know if you still need assistance.