Click here to Skip to main content
15,880,469 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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.
C#
public string UploadFileAsStream(System.IO.Stream myFileStream)
  { return "" };

2.
C#
public string UploadFile(HttpPostedFile myFile)
   {
           return "File posted";
   }
3.
C#
public ImageUploadFile(byte[] byteArrayIn)
    {
           MemoryStream ms = new MemoryStream(byteArrayIn);
           Image returnImage = Image.FromStream(ms);
           return returnImage;
    }
Posted
Updated 8-Aug-14 2:38am
v3
Comments
Tejas Vaishnav 17-Dec-14 9:32am    
Have my answer solve your question, then please mark it as answer and don't forget to rate it.

1 solution

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/[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900