0
在这里,我坚持我的工作,因为我只能上传一个小的kb大小的文件到一个驱动器,这是不够的。如何将大文件上传到使用Sdk的一个驱动器。现在我正在使用这个示例项目。 将大文件上传到oneDrive iOS SDk的一个驱动器?
此处上传仅显示图像和小尺寸kb文件到onedrive。我们如何使用Session来上传大文件?
func uploadFileToOneDrive(fileName : String,fileId : String, filePath : String){
print("filePath \(filePath)")
do {
let fileData = try! Data(contentsOf: NSURL(fileURLWithPath: filePath) as URL)
let fileLength = UInt64(fileData.count)
print(fileLength)
graphClient.me().drive().items(fileId + ":/createUploadSession").contentRequest().upload(from: fileData, completion: {
(updatedItem, error) in
if let nsError = error {
self.delegate?.errorHandling(error: nsError.localizedDescription)
}
else {
self.delegate?.Success(Sucess: NSLocalizedString("Uploaded", comment: ""))
self.oneDriveListFiles(path: fileId, folderId: fileId, isBack: true)
}
print(self.progress.fractionCompleted)
})
}
}
还帮我用progressBar来上传和下载?
感谢您的意见。其实我需要上传大.pdf文件而不是实际的图像。现在我正在使用onedrive SDK。我需要swift代码:) –