1

I have a list in Swift of a bunch of URL from pictures saved in a folder within the iOS device. What happens is that, I want to upload all those pictures to a folder and when I do it I get some pictures and not all. I'm using a loop to do go through every URL and uploading them one by one with in the loop.

Sometimes I get an http error. I think this is happening because too many files are being uploaded at the same time. But I don't know how to solve this problem.

for p in dbPictures {
    client.files.upload(path: "/\(fileName)/Pictures/\(p.picKey).jpeg", body: NSURL(fileURLWithPath: p.picPath))
}
3
  • So load less pictures concurrently, restrict the number of threads it can launch, are your using sessions to upload the photos? Commented Feb 18, 2016 at 17:51
  • [Cross-linking for reference: dropboxforum.com/hc/en-us/community/posts/… ]
    – Greg
    Commented Feb 18, 2016 at 18:49
  • no im not using sessions. let me try to look into that. this is the first time im using dropbox api so its a bit hard to understand whats going on. thx Commented Feb 18, 2016 at 18:56

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.