<?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 Swifty dropbox download file complete? in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Swifty-dropbox-download-file-complete/m-p/154552#M5150</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;How can I determine when the file I'm downloading is complete? Is there a callback or something?&lt;/P&gt;
&lt;P&gt;I'm using the Swifty dropbox API to download a video file (provided by the tutorial...)&lt;/P&gt;
&lt;P&gt;client.files.download(path: dbPath, destination: destination).response&lt;BR /&gt; {&lt;BR /&gt; response, error in&lt;BR /&gt; &lt;BR /&gt; if let (metadata, url) = response {&lt;BR /&gt; &lt;BR /&gt; } else {&lt;BR /&gt; print(error!)&lt;BR /&gt; }&lt;BR /&gt; }&lt;/P&gt;</description>
    <pubDate>Wed, 29 May 2019 09:35:13 GMT</pubDate>
    <dc:creator>Christian T.16</dc:creator>
    <dc:date>2019-05-29T09:35:13Z</dc:date>
    <item>
      <title>Swifty dropbox download file complete?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Swifty-dropbox-download-file-complete/m-p/154552#M5150</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;How can I determine when the file I'm downloading is complete? Is there a callback or something?&lt;/P&gt;
&lt;P&gt;I'm using the Swifty dropbox API to download a video file (provided by the tutorial...)&lt;/P&gt;
&lt;P&gt;client.files.download(path: dbPath, destination: destination).response&lt;BR /&gt; {&lt;BR /&gt; response, error in&lt;BR /&gt; &lt;BR /&gt; if let (metadata, url) = response {&lt;BR /&gt; &lt;BR /&gt; } else {&lt;BR /&gt; print(error!)&lt;BR /&gt; }&lt;BR /&gt; }&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:35:13 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Swifty-dropbox-download-file-complete/m-p/154552#M5150</guid>
      <dc:creator>Christian T.16</dc:creator>
      <dc:date>2019-05-29T09:35:13Z</dc:date>
    </item>
    <item>
      <title>Re: Swifty dropbox download file complete?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Swifty-dropbox-download-file-complete/m-p/154553#M5151</link>
      <description>&lt;P&gt;Yes, the "response" callback method in the snippet you posted only fires once the operation is complete. If you get a response object back, the download succeeded. If you get an error object back, there&amp;nbsp;was an error.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2016 06:37:56 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Swifty-dropbox-download-file-complete/m-p/154553#M5151</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2016-03-04T06:37:56Z</dc:date>
    </item>
    <item>
      <title>Re: Swifty dropbox download file complete?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Swifty-dropbox-download-file-complete/m-p/154554#M5152</link>
      <description>&lt;P&gt;Thanks but when I execute these print statements inside the block, it takes about 3-5 seconds &amp;nbsp;to print the NSData to the console, so I can't play the video back until it finishes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;print("*** Download file ***")&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; let data = NSData(contentsOfURL: url)&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; print("Downloaded file data: \(data)")&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2016 07:04:50 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Swifty-dropbox-download-file-complete/m-p/154554#M5152</guid>
      <dc:creator>Christian T.16</dc:creator>
      <dc:date>2016-03-04T07:04:50Z</dc:date>
    </item>
    <item>
      <title>Re: Swifty dropbox download file complete?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Swifty-dropbox-download-file-complete/m-p/154555#M5153</link>
      <description>&lt;P&gt;If you're referring to a delay before the callback is called, that's expected because the file has to be downloaded from the&amp;nbsp;Dropbox API servers over the network.&lt;/P&gt;
&lt;P&gt;If you're referring to a delay when calling&amp;nbsp;NSData.contentsOfURL, that also seems reasonable, since the entire (possibly large) file is being loaded from disk into memory.&lt;/P&gt;
&lt;P&gt;If you mean to play the downloaded video in a media player, you should pass the file URL to the media player instead of loading the raw data into memory and printing it.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2016 07:12:51 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Swifty-dropbox-download-file-complete/m-p/154555#M5153</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2016-03-04T07:12:51Z</dc:date>
    </item>
    <item>
      <title>Re: Swifty dropbox download file complete?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Swifty-dropbox-download-file-complete/m-p/154556#M5154</link>
      <description>&lt;P&gt;I'm actually getting the response back immediately, then the data from the video comes streaming across. There's no delay. In other words, it's giving me a response back when the file isn't fully downloaded.&lt;/P&gt;
&lt;P&gt;I'm not actually trying to play the video just yet. I'm trying to notify the user when it's fully downloaded, but the response is notifying too soon (coming back to quickly with file data not fully downloaded).&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2016 07:32:31 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Swifty-dropbox-download-file-complete/m-p/154556#M5154</guid>
      <dc:creator>Christian T.16</dc:creator>
      <dc:date>2016-03-04T07:32:31Z</dc:date>
    </item>
    <item>
      <title>Re: Swifty dropbox download file complete?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Swifty-dropbox-download-file-complete/m-p/154557#M5155</link>
      <description>&lt;P&gt;i decided to call a completionHandler after printing the NSData to console. That seems to introduce the delay of fully downloading the file before the completionHandler is called.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2016 07:54:01 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Swifty-dropbox-download-file-complete/m-p/154557#M5155</guid>
      <dc:creator>Christian T.16</dc:creator>
      <dc:date>2016-03-04T07:54:01Z</dc:date>
    </item>
    <item>
      <title>Re: Swifty dropbox download file complete?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Swifty-dropbox-download-file-complete/m-p/154558#M5156</link>
      <description>&lt;P&gt;I can't seem to reproduce the behavior you're describing, but I'm glad to hear you got this working the way you wanted.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2016 08:02:42 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Swifty-dropbox-download-file-complete/m-p/154558#M5156</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2016-03-04T08:02:42Z</dc:date>
    </item>
    <item>
      <title>Re: Swifty dropbox download file complete?</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Swifty-dropbox-download-file-complete/m-p/154559#M5157</link>
      <description>&lt;P&gt;Thanks, I'm gonna try a bigger video. A friend suggested that it might be fully downloading that fast and what I'm seeing in the console is queued data.&lt;/P&gt;</description>
      <pubDate>Fri, 04 Mar 2016 08:40:01 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Swifty-dropbox-download-file-complete/m-p/154559#M5157</guid>
      <dc:creator>Christian T.16</dc:creator>
      <dc:date>2016-03-04T08:40:01Z</dc:date>
    </item>
  </channel>
</rss>

