请问这段ios上传图片到C#

问题描述

//转码成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发送过来的流。

时间: 2024-08-04 21:18:22

请问这段ios上传图片到C#的相关文章

面向对象-请问这段程序的输出是什么 为什么

问题描述 请问这段程序的输出是什么 为什么 public class Test { public static void main(String[] args) { Animal a = new Dog(); a.syaHi(); Animal b = new Bulldog(); b.syaHi(); Dog dog = (Dog)b; dog.syaHi(); check(dog); Bulldog bulldog = (Bulldog)b; check(bulldog); } public

pb9刚接触,请问这段代码要怎样操作???望大神指点

问题描述 pb9刚接触,请问这段代码要怎样操作???望大神指点 alter table tbw_wh_info add c_wh_type varchar NULL GO EXEC sys.sp_addextendedproperty @name=N'MS_Description', @value=N'仓库类型(分仓,总仓)' , @level0type=N'SCHEMA',@level0name=N'dbo', @level1type=N'TABLE',@level1name=N'tbw_wh

请问这段代码为什么输出null,求大神解答程序执行的顺序?

问题描述 请问这段代码为什么输出null,求大神解答程序执行的顺序? public class xieCheng { private String baseName="Base"; public xieCheng(){ this.callName(); } public void callName(){ System.out.println(baseName); } } public class Sub extends xieCheng { private String baseNam

请问这段水仙花数程序有什么问题

问题描述 请问这段水仙花数程序有什么问题 #includevoid main(){ int a b de=0; for (a = 1:;a++) { do { b = a % 10; d = a / 10; e = e + b*b*b; a = d; } while (d != 0); if (a==e) printf("" %dn""e); }}大神求解答诊断程序在VS2013中没有警告或错误,但是执行时弹出框只是光标在闪烁,没有其他任何数字或字母请问这段程序有什

c#-请问这段代码的输出结果,and why?

问题描述 请问这段代码的输出结果,and why? class Person { private int age; public int Age { get { return age; } set { age = value; } } } class Program { static void Main(string[] args) { Console.WriteLine(GetPerson().Age); Console.ReadKey(); } static Person GetPerson

二维数组-请问这段代码中最后输出元素的时候,有必要加个空格吗?

问题描述 请问这段代码中最后输出元素的时候,有必要加个空格吗? static void Main(string[] args) { int[,] score = new int[3, 5]; score[0, 0] = 103; score[1,4] = 80; for (int i = 0; i <3; i++) { for (int j = 0; j < 5; j++) { Console.Write(score[i, j] + " "); Console.WriteL

调试-请问这段opencv代码为什么在debug下无法编译通过,但是release可以通过?

问题描述 请问这段opencv代码为什么在debug下无法编译通过,但是release可以通过? #include<opencv2corecore.hpp> #include<opencv2highguihighgui.hpp> using namespace cv; void main() { Mat image=imread("E:images7.jpg"); namedWindow("img"); imshow("img&qu

opencv c++-请问这段程序是什么意思呢?或者有没有大神帮我注释一下啊,跪谢啊!

问题描述 请问这段程序是什么意思呢?或者有没有大神帮我注释一下啊,跪谢啊! if(f) { if(!fgets(filename, (int)sizeof(_filename)-2, f)) break; //while(*filename && isspace(*filename)) // ++filename; if(filename[0] == '#') break; //continue; int l = (int)strlen(filename); while(l > 0

请问JSP页面如何上传图片到SQL2005数据库呢?

问题描述 请问JSP页面如何上传图片,且在INPUT文本框该怎么样输入图片路径呢?谢谢. 解决方案 解决方案二:一个表单enctype="multipart/form-data"method="post"<inputtype="file"name="file4"size="30">上传文件必须的三个条件.不知道是否符合lz的意思.解决方案三:需要使用组件上传.http://hi.baidu.co