Open topws opened 2 years ago
let request = OSSGetObjectRequest() request.bucketName = unpackedConfig.bucket request.objectKey = path request.downloadProgress = downloadProgress
request.onRecieveData = { data in fileHandle?.seekToEndOfFile() fileHandle?.write(data) } let getTask = unpackedClient.getObject(request) getTask.continue({ task in fileHandle?.closeFile() if let error = task.error { completion?(nil, error) } else { completion?(downloadToFileURL.path, nil) } return nil }, cancellationToken: nil)
let request = OSSGetObjectRequest() request.bucketName = unpackedConfig.bucket request.objectKey = path request.downloadProgress = downloadProgress