question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Skype] Can't download an attachment which a user sends to the bot.

See original GitHub issue

Version

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:closed
  • Created 4 years ago
  • Comments:6

github_iconTop GitHub Comments

1reaction
evgeniy-glushincommented, Sep 25, 2019
0reactions
dmvtechcommented, Oct 8, 2019

Closing this. Please let us know if you still need assistance.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found