0
我想在iOS上将多个文件上传到服务器。我有数据作为NSData,我想上传到服务器。我正在使用alamofire上传数据。我已经通过他们的文件,但无法找到很好的答案。我无法理解下面的代码如何使用NSData &多个图像。请提供解决方案。如何使用alamofire上传多个文件并显示进度?
let fileURL = Bundle.main.url(forResource: "video", withExtension: "mov")
Alamofire.upload(fileURL, to: "https://httpbin.org/post")
.uploadProgress { progress in // main queue by default
print("Upload Progress: \(progress.fractionCompleted)")
}
.downloadProgress { progress in // main queue by default
print("Download Progress: \(progress.fractionCompleted)")
}
.responseJSON { response in
debugPrint(response)
}
没有您code.Though你,我已经改进的代码错误。 – Techiee
随时编辑答案并加以改进。 @deepakkumar –
如何在上传过程中显示uitableviewcell中的进度条? –