<?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: Files not being downloaded completely in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Files-not-being-downloaded-completely/m-p/478889#M24194</link>
    <description>&lt;P&gt;I forgot to mention that it's intermittent and it seems the file is downloaded but, incases of failure, it will be missing an extension. It happens with images 1.5 - 5Mb in size, do you know anything about this?&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Sat, 12 Dec 2020 08:08:54 GMT</pubDate>
    <dc:creator>Jack Norton</dc:creator>
    <dc:date>2020-12-12T08:08:54Z</dc:date>
    <item>
      <title>Files not being downloaded completely</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Files-not-being-downloaded-completely/m-p/478498#M24180</link>
      <description>&lt;P&gt;Hi, I am using the following code and noticed that my file is not always downloaded completely. It even optimised with a loop (found online) but this did not solve the problem, can you please help?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;using var response = await DropboxClient.AsMember(memberId).Files.DownloadAsync(path).ConfigureAwait(false);
fileResponse.ContentType = "application/octet-stream";

using (var stream = await response.GetContentAsStreamAsync().ConfigureAwait(false))
{
    var bufferSize = 4096;
    var buffer = new byte[bufferSize];

    var readCount = await stream.ReadAsync(buffer, 0, bufferSize).ConfigureAwait(false);

    while (readCount &amp;gt; 0)
    {
        // File is a stream
        await fileResponse.File.WriteAsync(buffer, 0, readCount).ConfigureAwait(false);

        readCount = await stream.ReadAsync(buffer, 0, bufferSize).ConfigureAwait(false);
    }
}&lt;/PRE&gt;</description>
      <pubDate>Fri, 11 Dec 2020 08:41:48 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Files-not-being-downloaded-completely/m-p/478498#M24180</guid>
      <dc:creator>Jack Norton</dc:creator>
      <dc:date>2020-12-11T08:41:48Z</dc:date>
    </item>
    <item>
      <title>Re: Files not being downloaded completely</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Files-not-being-downloaded-completely/m-p/478703#M24188</link>
      <description>&lt;P&gt;If you step through with a debugger, where exactly in the code does this stop behaving as expected?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, how big is the file you're trying to download, how long does the (incomplete) download take, and that's the final size of the (incomplete) downloaded file?&lt;/P&gt;</description>
      <pubDate>Fri, 11 Dec 2020 15:18:06 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Files-not-being-downloaded-completely/m-p/478703#M24188</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2020-12-11T15:18:06Z</dc:date>
    </item>
    <item>
      <title>Re: Files not being downloaded completely</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Files-not-being-downloaded-completely/m-p/478889#M24194</link>
      <description>&lt;P&gt;I forgot to mention that it's intermittent and it seems the file is downloaded but, incases of failure, it will be missing an extension. It happens with images 1.5 - 5Mb in size, do you know anything about this?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sat, 12 Dec 2020 08:08:54 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Files-not-being-downloaded-completely/m-p/478889#M24194</guid>
      <dc:creator>Jack Norton</dc:creator>
      <dc:date>2020-12-12T08:08:54Z</dc:date>
    </item>
    <item>
      <title>Re: Files not being downloaded completely</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Files-not-being-downloaded-completely/m-p/479293#M24197</link>
      <description>&lt;P&gt;Are you referring to a file extension on fileResponse.File? That would be under your control, not a matter of the&amp;nbsp;Dropbox API/SDK.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For reference, the&amp;nbsp;Dropbox SDK just returns the file data as a stream from&amp;nbsp;GetContentAsStreamAsync(), not file metadata, such as the file name and extension. If you want the file metadata, you can get it from the response object, which in your case would look like 'response.Response'. You can find &lt;A href="https://github.com/dropbox/dropbox-sdk-dotnet/blob/43ec6a3273d461a6f06b9301791c7ac811a3bfb8/dropbox-sdk-dotnet/Examples/SimpleBlogDemo/Helpers/BlogHelpers.cs#L51" target="_self"&gt;an example here&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Dec 2020 16:13:09 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Files-not-being-downloaded-completely/m-p/479293#M24197</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2020-12-14T16:13:09Z</dc:date>
    </item>
    <item>
      <title>Re: Files not being downloaded completely</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Files-not-being-downloaded-completely/m-p/479496#M24207</link>
      <description>&lt;P&gt;No, I meant, for example, that I have an image.jpeg. I am receiving the file without the .jpeg extension so earlier I thought the file was not completely downloaded but I then realised that the file type was missing sometimes.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Dec 2020 08:16:47 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Files-not-being-downloaded-completely/m-p/479496#M24207</guid>
      <dc:creator>Jack Norton</dc:creator>
      <dc:date>2020-12-15T08:16:47Z</dc:date>
    </item>
    <item>
      <title>Re: Files not being downloaded completely</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Files-not-being-downloaded-completely/m-p/479584#M24208</link>
      <description>&lt;P&gt;The file name and extension, "image" and ".jpeg" in this case, would be included as part of the file name in the metadata returned by Dropbox, e.g., in&amp;nbsp;'response.Response'. Please refer to my previous comment for an example of accessing that. Of course,&amp;nbsp;Dropbox will only have the file name and extension as supplied to&amp;nbsp;Dropbox when the file was uploaded, so if the uploaded file didn't have an extension to begin with, none will be returned.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For reference, you can see in the documentation for&amp;nbsp;&lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/M_Dropbox_Api_Files_Routes_FilesUserRoutes_DownloadAsync_1.htm" target="_self"&gt;DownloadAsync&lt;/A&gt; that it gives you a &lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/T_Dropbox_Api_Files_FileMetadata.htm" target="_self"&gt;FileMetadata&lt;/A&gt; (in&amp;nbsp;'response.Response' in your case) on which you can access &lt;A href="https://dropbox.github.io/dropbox-sdk-dotnet/html/P_Dropbox_Api_Files_Metadata_Name.htm" target="_self"&gt;the Name property&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also, the definition of fileResponse and&amp;nbsp;fileResponse.File themselves aren't shown in the code you shared, but that's presumably how you're serving the file back to your end-users, and would be under your control. You may need to refer to the documentation for those classes for information on using them.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Dec 2020 15:01:56 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Files-not-being-downloaded-completely/m-p/479584#M24208</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2020-12-15T15:01:56Z</dc:date>
    </item>
  </channel>
</rss>

