Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/40.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 将图像从iPhone发送到.net服务器_C#_Iphone_.net_Objective C - Fatal编程技术网

C# 将图像从iPhone发送到.net服务器

C# 将图像从iPhone发送到.net服务器,c#,iphone,.net,objective-c,C#,Iphone,.net,Objective C,我想将图像从iPhone发送到服务器(.net) 在iPhone端,我使用以下方法发送图像: UIImage *myImg = ((UserData*)[UserData sharedUserData]).image; NSData *imageData = UIImageJPEGRepresentation(myImg, 0.5); imageRequest = [ASIFormDataRequest requestWithURL:url]; [imageRequest addData:im

我想将图像从iPhone发送到服务器(.net)

在iPhone端,我使用以下方法发送图像:

UIImage *myImg = ((UserData*)[UserData sharedUserData]).image;
NSData *imageData = UIImageJPEGRepresentation(myImg, 0.5);

imageRequest = [ASIFormDataRequest requestWithURL:url];
[imageRequest addData:imageData withFileName:@"someFileName.jpeg" andContentType:@"image/jpeg" forKey:@"uploadedImage"];
[imageRequest setDelegate:self];
[imageRequest setRequestMethod:@"POST"];
[imageRequest startAsynchronous];
在服务器端,这是:

string input = null;

using (StreamReader sr = new StreamReader(Request.InputStream))
{
       input = sr.ReadToEnd();
}

Response.Write(input);
return;
然后,当我打印
输入时,我得到:

--0xKhTmLbOuNdArY-62D4D088-0CE1-4D32-BE57-2ED976BDF9FE
Content-Disposition: form-data; name="uploadedImage"; filename="someFileName.jpeg"
Content-Type: image/jpeg

����

现在我的问题是,我无法将映像保存到服务器中的磁盘上,我在任何地方都找不到这个问题的答案。

您的Objective-C代码看起来不错,我使用了Google fu并找到了此ASP.net指南:

在我看来,这正是你试图做的,所以我希望这能有所帮助