我想像以前一样使用setkey“FileData”将(POST)图像上传到服务器(用ASIHTTPRequest编写并且它有效)
[self.request setData:imageData withFileName:dateFormatted andContentType:@"image/jpeg" forKey:@"Filedata"];
使用 AFNetworking 我设置如下:
NSMutableURLRequest *afRequest = [httpClient multipartFormRequestWithMethod:@"POST" path:@"" parameters:paramsDic constructingBodyWithBlock: ^(id <AFMultipartFormData>formData) {
[formData appendPartWithFileData:imageData name:@"Filedata" fileName:dateFormatted mimeType:@"image/jpeg"];
}];
似乎名称实际上不起作用...我应该如何设置密钥?@马特
谢谢