<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Problems downloading big size files (20 GB) from the API .NET in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Problems-downloading-big-size-files-20-GB-from-the-API-NET/m-p/495190#M24705</link>
    <description>&lt;P&gt;Thanks for following up and confirming the size varies.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, just to clarify your last message, where you mentioned it failed after exactly 15 minutes, does it always fails after exactly 15 minutes (or did you mean just this last attempt in particular)?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And you mentioned there was no error, but does it get to your "Console.WriteLine("Error al descargar");" line, or does it seem to stop somewhere before that?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to reproduce this, but it seems to be working fine for me, even when downloading takes longer than 15 minutes.&lt;/P&gt;</description>
    <pubDate>Tue, 09 Feb 2021 20:53:49 GMT</pubDate>
    <dc:creator>Greg-DB</dc:creator>
    <dc:date>2021-02-09T20:53:49Z</dc:date>
    <item>
      <title>Problems downloading big size files (20 GB) from the API .NET</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Problems-downloading-big-size-files-20-GB-from-the-API-NET/m-p/494739#M24692</link>
      <description>&lt;P&gt;Hello.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to download some files from a couple of folders in dropbox, but when I try to download a couple of files that I have of about 20 gb, something strange happens. It appears that the file is downloaded correctly, but the file size in my local computer is about 13 gb, so the file it's corrupted. with 5gb files or lower this doesn't happen. this is the code.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;dropboxFileInfo = (FileMetadata)item;&lt;/P&gt;
&lt;P&gt;using (var response = await dbx.Files.DownloadAsync(dropboxFileInfo.PathLower.ToString()))&lt;BR /&gt;{&lt;BR /&gt;Console.WriteLine("Descargando " + dropboxFileInfo.Name.ToString() + "...");&lt;BR /&gt;using (FileStream fileStream = File.Create(localname))&lt;BR /&gt;{&lt;/P&gt;
&lt;P&gt;(await response.GetContentAsStreamAsync()).CopyTo(fileStream);&lt;BR /&gt;var local = Convert.ToInt64(fileStream.Length);&lt;BR /&gt;var cloud = Convert.ToInt64(dropboxFileInfo.Size);&lt;/P&gt;
&lt;P&gt;if (local == cloud)&lt;BR /&gt;{&lt;BR /&gt;&lt;BR /&gt;Console.WriteLine("Descargado");&lt;BR /&gt;}&lt;BR /&gt;else&lt;BR /&gt;{&lt;BR /&gt;Console.WriteLine("Error al descargar");&lt;/P&gt;
&lt;P&gt;}&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Feb 2021 20:25:28 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Problems-downloading-big-size-files-20-GB-from-the-API-NET/m-p/494739#M24692</guid>
      <dc:creator>hramosvz</dc:creator>
      <dc:date>2021-02-08T20:25:28Z</dc:date>
    </item>
    <item>
      <title>Re: Problems downloading big size files (20 GB) from the API .NET</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Problems-downloading-big-size-files-20-GB-from-the-API-NET/m-p/494764#M24699</link>
      <description>&lt;P&gt;Does the actual downloaded size vary, or is it the same each time? If it's the same, please let me know what it is for reference.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, how long does the (incomplete) download take? I believe a single connection is only valid for 90 minutes, so that could be the cause if it takes that long. (Though the HTTPS client is expected to throw an error in that case when it sees the response is incomplete, but that may not be&amp;nbsp;occurring unfortunately.)&lt;/P&gt;</description>
      <pubDate>Mon, 08 Feb 2021 17:18:03 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Problems-downloading-big-size-files-20-GB-from-the-API-NET/m-p/494764#M24699</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2021-02-08T17:18:03Z</dc:date>
    </item>
    <item>
      <title>Re: Problems downloading big size files (20 GB) from the API .NET</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Problems-downloading-big-size-files-20-GB-from-the-API-NET/m-p/494859#M24700</link>
      <description>&lt;P&gt;It varies. I did some more testing and it also happens with smaller files. I was downloading a file of 3.48 GB but just 1.75 GB were downloaded. This happened in exaclty 15 minutes without any error showing. This the complete method code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;      private async Task&amp;lt;int&amp;gt; Run()
        {
            DropboxCertHelper.InitializeCertPinning();

            

            // Specify socket level timeout which decides maximum waiting time when no bytes are
            // received by the socket.
            var httpClient = new System.Net.Http.HttpClient(new WebRequestHandler { ReadWriteTimeout = 100 * 10000000 })
            {
                // Specify request level timeout which decides maximum time that can be spent on
                // download/upload files.
                Timeout = TimeSpan.FromHours(10)
            };

            try
            {
                var config = new DropboxClientConfig("SubidaBacks")
                {
                    HttpClient = httpClient
                };

                var dbx = new DropboxClient("************", config);

                var nbackups = 0;
                var ListaBaks = new List&amp;lt;string&amp;gt;();
               

                using (dbx)
                {


                    var full = await dbx.Users.GetCurrentAccountAsync();


                    foreach (var folder in Folders.Split(';'))
                    {
                        var listOfFolders = await dbx.Files.ListFolderAsync(folder, true);

                        FolderMetadata dropboxFolderInfo = new FolderMetadata();
                        FileMetadata dropboxFileInfo = new FileMetadata();
                        Int64 local, cloud;



                        foreach (var item in listOfFolders.Entries)
                        {
                            try
                            {
                                if (item.IsFile)
                                {

                                    foreach (var fecha in Dates())
                                    {

                                        if (item.Name.ToString().Contains(fecha))
                                        {

                                            var localname = localFilePath + "\\" + item.Name;

                                            if (!File.Exists(localname))
                                            {
                                                dropboxFileInfo = (FileMetadata)item;
                                                var response = await dbx.Files.DownloadAsync(dropboxFileInfo.PathLower.ToString());
                                                ulong fileSize = response.Response.Size;
                                                const int bufferSize = 1024 * 1024;

                                                var buffer = new byte[bufferSize];

                                                Console.WriteLine("Descargando " + dropboxFileInfo.Name.ToString() + "...");

                                                using (var stream = await response.GetContentAsStreamAsync())
                                                {
                                                    using (var file = new FileStream(localname, FileMode.OpenOrCreate))
                                                    {
                                                        var length = stream.Read(buffer, 0, bufferSize);

                                                        while (length &amp;gt; 0)
                                                        {
                                                            file.Write(buffer, 0, length);
                                                            var percentage = 100 * (ulong)file.Length / fileSize;
                                                            // Update progress bar with the percentage.
                                                            // progressBar.Value = (int)percentage
                                                            Console.WriteLine(percentage.ToString()+"% - "+ dropboxFileInfo.Name.ToString() +" - " + DateTime.Now.ToString());

                                                            length = stream.Read(buffer, 0, bufferSize);
                                                        }

                                                         local = Convert.ToInt64(file.Length);
                                                         cloud = Convert.ToInt64(dropboxFileInfo.Size);

                                                       

                                                    }


                                                }

                                                if (local == cloud)
                                                {
                                                    ListaBaks.Append(item.PathLower.ToString());
                                                    nbackups = nbackups + 1;
                                                    Console.WriteLine("Descargado");
                                                    
                                                }
                                                else
                                                {
                                                    File.Delete(localname);
                                                    Console.WriteLine("Error al descargar");

                                                }

                                                
                                            }
                                        }
                                    }
                                }
                            }
                            catch (Exception ex)
                            {
                                Console.WriteLine(ex.Message);
                            }
                        }
                    }


                }

                // Correo.EnvioCorreo(nbackups.ToString(), string.Join("\n", ListaBaks));

            }
            catch (HttpException e)
            {
                Console.WriteLine("Exception reported from RPC layer");
                Console.WriteLine("    Status code: {0}", e.StatusCode);
                Console.WriteLine("    Message    : {0}", e.Message);
                if (e.RequestUri != null)
                {
                    Console.WriteLine("    Request uri: {0}", e.RequestUri);
                }
            }

            return 0;
        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 08 Feb 2021 21:31:31 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Problems-downloading-big-size-files-20-GB-from-the-API-NET/m-p/494859#M24700</guid>
      <dc:creator>hramosvz</dc:creator>
      <dc:date>2021-02-08T21:31:31Z</dc:date>
    </item>
    <item>
      <title>Re: Problems downloading big size files (20 GB) from the API .NET</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Problems-downloading-big-size-files-20-GB-from-the-API-NET/m-p/495190#M24705</link>
      <description>&lt;P&gt;Thanks for following up and confirming the size varies.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, just to clarify your last message, where you mentioned it failed after exactly 15 minutes, does it always fails after exactly 15 minutes (or did you mean just this last attempt in particular)?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And you mentioned there was no error, but does it get to your "Console.WriteLine("Error al descargar");" line, or does it seem to stop somewhere before that?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to reproduce this, but it seems to be working fine for me, even when downloading takes longer than 15 minutes.&lt;/P&gt;</description>
      <pubDate>Tue, 09 Feb 2021 20:53:49 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Problems-downloading-big-size-files-20-GB-from-the-API-NET/m-p/495190#M24705</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2021-02-09T20:53:49Z</dc:date>
    </item>
  </channel>
</rss>

