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))
}