Click here to Skip to main content
15,886,362 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Can anybody tell me how to access the image send from swift in my c# web API for saving to server?
Posted

I got the answer!!

[System.Web.Http.HttpPost]
[HttpRoute("api/Controller/Action")]
public JsonResult Test([FromBody]TestModel test)
{
System.Web.Mvc.JsonResult usertoreturn = new System.Web.Mvc.JsonResult();
usertoreturn.Data = test;
return usertoreturn;
}

in testmodel we have the string variable to save the image in base64 string format. That is the image is converted to base64 string and send to API.
 
Share this answer
 
v2
I have found the solution. Before sending convert the image to base64 string and the send it to ASP.NET web API. In the API convert the base string to image and save.
 
Share this answer
 
Comments
CHill60 16-Dec-15 6:06am    
We guessed that you got the solution based on the Solution you posted on 30-November

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