如何将照片和视频上传到支持多平台的服务器,如IOS / Android / .NET等。 [英] How to Upload Photo and Video to server from that supports multiple platform such as IOS/ Android / .NET etc..

查看:125
本文介绍了如何将照片和视频上传到支持多平台的服务器,如IOS / Android / .NET等。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我需要创建API调用,以便从Android和iPhone等移动应用程序上传照片和视频。



我有以下方法,但是当从移动客户端APP请求时它会抛出错误或没有得到响应。任何帮助都将受到高度赞赏。



1.

Hi,

I have a requirement to create a API call to upload photo and video from mobile applications such as Android and IPhone.

I have following methods but it throws error or not getting response when requested from mobile client APP. Any help would be highly appreciated.

1.

public string UploadFileAsStream(System.IO.Stream myFileStream)
  { return "" };



2.


2.

public string UploadFile(HttpPostedFile myFile)
   {
           return "File posted";
   }

3。

public ImageUploadFile(byte[] byteArrayIn)
    {
           MemoryStream ms = new MemoryStream(byteArrayIn);
           Image returnImage = Image.FromStream(ms);
           return returnImage;
    }

推荐答案

您可以通过使用WCF Restful服务实现此目的,这里是WCF Restful的示例上传和下载文件的服务,你可以把它作为参考,并创建自己的网络方法来实现你的目标。



使用.NET 3.5中的WCF REST服务上传/下载文件 [ ^ ]



http://www.c-sharpcorner.com/UploadFile/6a5c37/downloading-and-uploading-file-using-wcf-rest-services-with/ [ ^ ]
You can achieve this by using WCF Restful service, here is an example for WCF Restful service for uploading and downloading file, you can take it as reference and create your own web methods to achieve your goal.

Uploading/Downloading a file using WCF REST service in .NET 3.5[^]

http://www.c-sharpcorner.com/UploadFile/6a5c37/downloading-and-uploading-file-using-wcf-rest-services-with/[^]


这篇关于如何将照片和视频上传到支持多平台的服务器,如IOS / Android / .NET等。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆