upload Image on swift 3

static func uploadImageItem(_ idItem:String,imgage:UIImageView,callBack:@escaping (_ check:Int,_ result:String,_ data:JSON,_ meta:JSON) -> Void){
let urlRequest = URL(string:APIManager.baseURLString + "items/\(idItem)/upload?access_token=\(KeychainSwift().get(TOKEN)!)")
Alamofire.upload(multipartFormData: { (multipartFormData) in
if let imageData = imgage.image?.resizeToWidth(1024).highQualityJPEGNSData {
multipartFormData.append(imageData, withName: "image", fileName: "file.jpg", mimeType: "image/jpg")
}
}, to: urlRequest!)
{ (result) in
//result
switch result {
case .success(let upload, _, _):
upload.responseJSON { response in
if let value = response.result.value as? [String:AnyObject] {
callBack(handleRespon(JSON(value)).check, handleRespon(JSON(value)).result,handleRespon(JSON(value)).data,handleRespon(JSON(value)).meta)
}else {
delayWithSeconds(3) {
callBack(1, "Network problem.".localized(), JSON("{}"), JSON("{}"))
}
}
}
case .failure( _):
//Alert faild
delayWithSeconds(3) {
callBack(1, "Network problem.".localized(), JSON("{}"), JSON("{}"))
}
}
}
}