Cut the Clutter: Test Ignore Files Feature - sign up to become a beta tester here.

Forum Discussion

3 Replies

  • Привет. Подскажите, как написать код на C # для правильной загрузки больших файлов.

     

    using (var response = await dbx.Files.DownloadAsync (PathDrop)) 
    {

    используя (var fileStream = File.Create (PathLocal))
    {
    response.GetContentAsStreamAsync (). Result.CopyTo (fileStream);
    }
    }

     

    Я так понимаю, проблема в таймауте.

    var aHttpClient = новый HttpClient (новый WebRequestHandler {ReadWriteTimeout = 10 * 1000}) {Timeout = TimeSpan.FromMinutes (20)};

     

    Ранее решение было представлено следующим образом.
    Но сейчас это не работает. Подскажите, как правильно написать код, если можно пример. 

     

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    5 years ago

    Я буду рад помочь, но мне понадобится дополнительная информация. Пожалуйста, ответьте:

     

    • номер версии используемого вами Dropbox SDK
    • размер файла, который вы пытаетесь скачать
    • полный текст любой ошибки или неожиданного вывода
    • время, необходимое для вызова API, прежде чем возникнет проблема

    -----------–
    Пожалуйста, извините нас за качество перевода. Ответы мы пишем с помощью автоматического переводчика. Мы очень хотели бы предоставить перевод на всех языках, но в настоящее время не располагаем соответствующими возможностями. Здесь можно посмотреть версию на английском:
    -----------–
    Please excuse our translations. Our responses were created using an online translator. We'd like to support every language, but we're not currently equipped to do so. Here is the English version:
    -----------–

    I'll be happy to help, but I'll need some more information. Please reply with:

     

    • the version number of the Dropbox SDK you're using
    • the size of the file you're trying to download
    • the full text of any error or unexpected output
    • the length of time the API call takes before the issue occurs
  • roman prog 89 level_'s avatar
    roman prog 89 level_
    Explorer | Level 3
    5 years ago
    Thank you, the solution to the question is the code below.

     

    var httpClient = new HttpClient();

    httpClient.Timeout = new TimeSpan(1, 0, 0);

About Discuss Dropbox Developer & API

Node avatar for Discuss Dropbox Developer & API
Make connections with other developers815 PostsLatest Activity: 2 years ago
280 Following

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

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!