I am new for AWS, I have done some file uploading into AWS S3 with TransferUtility file transformation. Here my scenario steps
1. Picking the files from iCloud
public func documentPicker(_ controller: UIDocumentPickerViewController, didPickDocumentAt url: URL) {
let fileurl: URL = url as URL
let filename = url.lastPathComponent
let file-extension = url.pathExtension
let filedata = url.dataRepresentation
// Call upload function
upload(file: fileurl, keyname: filename, exten: file-extension)
// Append names into array
items.append(item(title: filename, size: string))
self.tableView_util.reloadData()
2. Upload that file into AWS S3 with transfer-utility
private func upload(file url: URL, keyname : String, exten: String) {
transferUtility.uploadfile(file ur,
bucket: "YourBucket",
key: "YourFileName",
contentType: "text/plain",
expression: expression,
completionHandler: completionHandler).continueWith {
(task) -> AnyObject! in
if let error = task.error {
print("Error: \(error.localizedDescription)")
}
if let _ = task.result {
// Do something with uploadTask.
}
return nil;
}
3. While upload need to show each file uploading status into tableview cell
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "cellutil", for: indexPath) as! UtilityTableViewCell
let item = items[indexPath.row]
}
My Issue: The tableview I can able to show uploading items but first uploading stopped when I upload next one. I need to achieve parallel upload multiple files and show on cell status.