Skip to content

LeeCenY/Perfect-Qiniu

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Perfect-Qiniu:Swift Perfect 服务器上传文件到七牛云

依赖库:

.package(url: "https://github.com/PerfectlySoft/Perfect-CURL.git", from: "3.0.6"),
.package(url: "https://github.com/PerfectlySoft/Perfect-Crypto.git", from: "3.1.2") 

安装:

.package(url: "https://github.com/LeeCenY/Perfect-Qiniu.git", from: "1.0.4") 

使用:

let config = QiniuConfiguration(accessKey: AccessKey, secretKey: SecretKey, scope: scope, fixedZone: .HNzone, DEBUG: false)
_ = try Qiniu.upload(fileName: zipName, file: thisZipFile, config: config)

异常处理:

public enum UploadError: Error {
case badToken
case RequestfFailed(String)
}