问题描述
//转码成UTF-8否则可能会出现错误NSString*URLTmp=@"http://192.168.1.9/App/SpyShopApp/AddRestImg.ashx";NSString*URLTmps=[URLTmpstringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];URLTmp=URLTmps;NSMutableURLRequest*request=[[AFHTTPRequestSerializerserializer]multipartFormRequestWithMethod:@"POST"URLString:URLTmpparameters:nilconstructingBodyWithBlock:^(id<AFMultipartFormData>formData){[formDataappendPartWithFileData:imageDataname:@"images"fileName:@"1000.jpg"mimeType:@"image/jpeg"];}error:nil];AFURLSessionManager*manager=[[AFURLSessionManageralloc]initWithSessionConfiguration:[NSURLSessionConfigurationdefaultSessionConfiguration]];NSProgress*progress=nil;NSURLSessionUploadTask*uploadTask=[manageruploadTaskWithStreamedRequest:requestprogress:&progresscompletionHandler:^(NSURLResponse*response,idresponseObject,NSError*error){if(error){UIAlertView*alert=[[UIAlertViewalloc]initWithTitle:@"Error"message:[NSStringstringWithFormat:@"%@",error]delegate:selfcancelButtonTitle:@"OK"otherButtonTitles:nil,nil];[alertshow];NSLog(@"Error:%@,responseObject=%@",error,responseObject);}else{NSLog(@"提交成功~~~%@%@",response,responseObject);}}];[uploadTaskresume];
解决方案
解决方案二:
C#的一般处理程序中怎么接受ios那边的上传图片,并把路径保存到数据库
解决方案三:
楼主有解决吗,求直接,我现在不知道怎么接受IOS发送过来的流。