<?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 How to Upload Files Asynchronously in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-Upload-Files-Asynchronously/m-p/227226#M12363</link>
    <description>&lt;P&gt;I'm running into trouble uploading too many files at once. &amp;nbsp;How do I upload asynchronously. &amp;nbsp;Or even just a hint for which direction to look for answers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I'm doing is saving the same under several different names contained in the fileNumberArray.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;for number in fileNumberArray {
            
                        let request = client?.files.upload(path: "/Path/(number).mp3", mode: .overwrite, autorename: false, clientModified: nil, mute: false, input: audioURL)
                            .response { response, error in
                                if let response = response {
                                    print(response)
                                } else if let error = error {
                                    print(error)
                                }
                            }
                            .progress { progressData in
                                
                                if let myProgress = progressData as? Progress {

                                    self.progressView.progress = Float(progressData.fractionCompleted)
                                    
                                }
                        }
                        
                    }
            
        })
&lt;/PRE&gt;</description>
    <pubDate>Wed, 29 May 2019 09:21:29 GMT</pubDate>
    <dc:creator>Vegepilot</dc:creator>
    <dc:date>2019-05-29T09:21:29Z</dc:date>
    <item>
      <title>How to Upload Files Asynchronously</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-Upload-Files-Asynchronously/m-p/227226#M12363</link>
      <description>&lt;P&gt;I'm running into trouble uploading too many files at once. &amp;nbsp;How do I upload asynchronously. &amp;nbsp;Or even just a hint for which direction to look for answers.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;What I'm doing is saving the same under several different names contained in the fileNumberArray.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;for number in fileNumberArray {
            
                        let request = client?.files.upload(path: "/Path/(number).mp3", mode: .overwrite, autorename: false, clientModified: nil, mute: false, input: audioURL)
                            .response { response, error in
                                if let response = response {
                                    print(response)
                                } else if let error = error {
                                    print(error)
                                }
                            }
                            .progress { progressData in
                                
                                if let myProgress = progressData as? Progress {

                                    self.progressView.progress = Float(progressData.fractionCompleted)
                                    
                                }
                        }
                        
                    }
            
        })
&lt;/PRE&gt;</description>
      <pubDate>Wed, 29 May 2019 09:21:29 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-Upload-Files-Asynchronously/m-p/227226#M12363</guid>
      <dc:creator>Vegepilot</dc:creator>
      <dc:date>2019-05-29T09:21:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to Upload Files Asynchronously</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-Upload-Files-Asynchronously/m-p/227553#M12372</link>
      <description>The SwiftyDropbox library runs API requests for these methods asynchronously. That is, when you call client.files.upload, that method will return before the API request itself completes.&lt;BR /&gt;&lt;BR /&gt;So, to limit how many are running at once, you need control how many times you call client.files.upload to begin with. You can't just run it in a loop like this because code execution will continue through the next iterations before the API requests for the previous calls complete.&lt;BR /&gt;&lt;BR /&gt;Exactly how you manage this is up to you. You can use whatever makes sense for your app. For example, you can keep track of how many calls you've kicked off and then update that state (and kick off more if appropriate) in the response block. Alternatively, you may want to use a semaphore.</description>
      <pubDate>Tue, 20 Jun 2017 19:59:38 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/How-to-Upload-Files-Asynchronously/m-p/227553#M12372</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2017-06-20T19:59:38Z</dc:date>
    </item>
  </channel>
</rss>

