我试图上传图片到我的网络服务器时收到此错误。我刚刚复制并粘贴了github上的alamofire样本,我马上收到一个错误消息。我的代码如下:模糊引用会员上传alamofire
let data = UIImageJPEGRepresentation(picOutlet.image, 0.5)
Alamofire.upload(.POST, "phpurlhere", file: photo)
.progress { bytesWritten, totalBytesWritten, totalBytesExpectedToWrite in
print(totalBytesWritten)
// This closure is NOT called on the main queue for performance
// reasons. To update your ui, dispatch to the main queue.
dispatch_async(dispatch_get_main_queue()) {
print("Total bytes written on main queue: \(totalBytesWritten)")
}
}
.validate()
.responseJSON { response in
debugPrint(response)
}
更新:我添加JPEG表示要传递给alamofire功能,但仍然得到同样的错误。
你收到了什么错误? – pableiros
模糊引用成员上传(_:_:headers:file :)' – Martheli
你为什么在url参数上使用'phpurlhere'而不是url? – pableiros