更新时间:2022-05-05 21:25:26
1)在(任务,错误) - > Void in
打印错误(如果存在),因为如果出现问题,您会收到错误。
1) In (task, error) -> Void in
print error if it exists, because if something goes wrong you receive error there.
NSLog("%@", error.localizedDescription)
2)您确定名称:1
是否写入?因为这是后端获取文件数据的字段名称(询问后端开发人员的此字段名称)
2) Are you sure that name: "1"
is write? Because this is the name of field where the backend get the file data (ask about this field name your backend developer)
3)将文件类型 jpeg
附加到上传图片名称:
3) Append file type jpeg
to uploading image name:
formData.appendPartWithFileData(imageData, name: "1", fileName: "userimage\(self.objManager.userID).jpeg", mimeType: "image/jpeg")