Swift 3 Alamofire multipart upload

后端 未结 4 595
被撕碎了的回忆
被撕碎了的回忆 2020-12-13 12:21

Thanks to migration to Swift 3, I find it difficult to compile my project that uses Alamofire.

The problem occurs when uploading multipartFormData:

A         


        
4条回答
  •  自闭症患者
    2020-12-13 12:59

    Try this one and url set as @pedrouan said.

    Alamofire.upload(multipartFormData: { (multipartFormData) in
           multipartFormData.append(imageData, withName: "xyz", fileName: "file.jpeg", mimeType: "image/jpeg")
    }, to: url) 
    { (result) in
          //result
    }
    

提交回复
热议问题