简体   繁体   English

如何使用Xamarin Forms将照片上传到Web服务

[英]How to upload a photo to a webservice using Xamarin Forms

I am trying to upload a photo to my data base using Xamarin forms. 我正在尝试使用Xamarin表单将照片上传到我的数据库中。 I have the image. 我有图像。 How would I use HTTP Post to push it up to the web service? 我将如何使用HTTP Post将其推送到Web服务?

Thanks 谢谢

First: write code to covert your image to base64 string. 第一:编写代码将您的图像转换为base64字符串。 Second: Pass this string to your web service using HTTP Post. 第二:使用HTTP Post将此字符串传递到您的Web服务。 third: in your web service write code to convert this base64 string to image. 第三:在您的Web服务中编写代码以将此base64字符串转换为图像。 fourth: store that image in your server directory 第四:将该图像存储在服务器目录中

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM