简体   繁体   English

如何从Android的Windows Azure移动服务中上传图像?

[英]How to upload image in windows azure mobile service from android.?

I am new in android I am using windows azure mobile service and I am Inserting Text data successfully but now I want to Upload Image in windows azure mobile service. 我是android的新手,正在使用Windows azure移动服务,并且已成功插入文本数据,但现在我想在Windows azure移动服务中上传图片。 I know its is possible by Azure Storage I have seen this post http://chrisrisner.com/Storing-Images-from-Android-in-Windows-Azure-Mobile-Services but its confusing can anyone tell me simple step by step process to save image in windows azure mobile service. 我知道Azure存储是可能的,我已经看过这篇文章http://chrisrisner.com/Storing-Images-from-Android-in-Windows-Azure-Mobile-Services,但是任何人都可以通过简单的逐步过程告诉我它令人困惑在Windows Azure移动服务中保存图像。

I will be Very Grateful for you 我会很感激你

The page you're looking at does not use the best recommended approach for storing image data with Azure Mobile Services. 您正在查看的页面未使用推荐的最佳方法通过Azure移动服务存储图像数据。 Instead, you should connect to Azure Blob Storage when you want to store a file. 相反,当您要存储文件时,应连接到Azure Blob存储。 You can see a full tutorial of connecting to Blob Storage and saving files from an Android app here: http://chrisrisner.com/Android-and-Mobile-Services-and-Windows-Azure-Storage . 您可以在以下位置查看完整的教程,以连接到Blob存储并从Android应用程序保存文件: http : //chrisrisner.com/Android-and-Mobile-Services-and-Windows-Azure-Storage Essentially the steps you follow are: 本质上,您遵循的步骤是:

  1. Create a table script / custom API in your mobile service that will save your data as well as generate a Secure Access Signature (SAS) URL from Blob Storage. 在您的移动服务中创建一个表脚本/自定义API,该脚本将保存您的数据并从Blob存储生成安全访问签名(SAS)URL。
  2. Call that endpoint from your mobile app. 从您的移动应用程序调用该端点。
  3. Return the SAS URL from the endpoint. 从端点返回SAS URL。
  4. When you get the URL back on your mobile app, use that URL to post your image file. 当您在移动应用上重新获得该URL时,请使用该URL发布图像文件。

The way that older approach uses is to convert the image data into a format that can be stored using Azure Mobile Services SQL Database. 旧方法使用的方法是将图像数据转换为可以使用Azure移动服务SQL数据库存储的格式。 This does work, however, it's very inefficient. 确实可以,但是效率很低。

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

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