Take Your Search Game to the Next Level with Dropbox Dash  🚀✨ Curious how it works? Ask us here! 

Forum Discussion

JoeShoshana's avatar
JoeShoshana
Explorer | Level 3
6 years ago

Dropbox & ASP.NET integration

Hi,

I'm using  dropbox.api for c# for downloading files.

in the console project it works perfectly but in the ASP.NET (for now localhost server)

is get stuck in dbx.Files,DownloadAsync Method.

here's the code(very simple):

private async Task _Download(string folder, string file, string destination)
        {
            using (var response = await dbx.Files.DownloadAsync( "/"  + folder + "/" + file))
            {
                using (var fileStream = File.Create(destination))
                {
                    (await response.GetContentAsStreamAsync()).CopyTo(fileStream);
                }               
            }
        }

As i  said, it works in Console Project but not in ASP.NET project

5 Replies

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    Can you clarify what you mean when you say "is get stuck in dbx.Files,DownloadAsync Method"?

    Are you getting any error or output? 

    • JoeShoshana's avatar
      JoeShoshana
      Explorer | Level 3

      I'm not getting any error nor output

      the program stop responding in the line: using (var response = await dbx.Files.DownloadAsync( "/"  + folder + "/" + file)) with no excpetion being thrown

      in app console it works great but in ASP.NET it get stuck

       

      • Greg-DB's avatar
        Greg-DB
        Icon for Dropbox Staff rankDropbox Staff

        Thanks for following up. There doesn't appear to be anything wrong in the code you posted, so there are a few things to check next:

        • is there anything on your network connection, e.g., proxy, firewall, anti-virus, or other security software, that may be interfering with the connection?
        • how big is the file that you're trying to download?
        • how are you determining which line is hanging? Did you step through with the debugger?

About Discuss Dropbox Developer & API

Node avatar for Discuss Dropbox Developer & API
Make connections with other developers810 PostsLatest Activity: 13 days ago
248 Following

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X or Facebook.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!