如何使用ios的blob存储服务? [英] How to use the blob storage service from ios?
问题描述
在我的应用程序中,我需要使用Windows Azure服务存储我正在使用的数据: http://www.windowsazure.com/en-us/develop/mobile/tutorials/get-started-with-data-ios/ sdk for Windows azure从我的应用程序集成。现在我需要将图像上传到Azure,为此我使用相同的sdk ...但后来我发现Windows Azure中用于上传较大图像的正确位置是Blob Storage Client。
在.Net中,他们有不同的库,我找到了这个链接 http://www.windowsazure.com/en-us/develop/net/how-to-guides/blob-storage/ 。
但我怎么能用Objective C做到这一点?
经过一番研究后我发现这个链接 http://www.deviantpoint.com/post/2012/02/18/Using-Azure-Storage-Services-from-an-iPhone -App-Part-1-Table-and-Blob-setup-Azure-iOS-toolkit-and-Model-Classes.aspx 但不清楚如何上传图片和获取图片网址作为回应?
经过大量研发后......我终于找到了解决方案。 。
这是我用Objective C编写的示例项目 Blob示例 / p>
&也试过Swift&按预期工作。这是我的 Swift示例项目。
只需更换您的帐户相应的证书,你很高兴.. !!
注意:
尝试使用 UIImageJPEGRepresentation
而不是 UIImagePNGRepresentation
因为png的大小比jpg大。
In my application I need to use the Windows Azure services to store the data for that I am using this:http://www.windowsazure.com/en-us/develop/mobile/tutorials/get-started-with-data-ios/ sdk for Windows azure integration from my app. Now I need to upload the images to Azure and for that I was using the same sdk...But later I found that the right place in Windows Azure to upload the larger images is to Blob Storage Client.
In .Net they have the different library and I found this link http://www.windowsazure.com/en-us/develop/net/how-to-guides/blob-storage/ for uploading the images to blob storage.
But how can I do that with Objective C?
After some research I found this link http://www.deviantpoint.com/post/2012/02/18/Using-Azure-Storage-Services-from-an-iPhone-App-Part-1-Table-and-Blob-setup-Azure-iOS-toolkit-and-Model-Classes.aspx but its not clear about How to upload an image and getting the image url in response?
After a lots of R&D...I finally found the solution..
Here is my sample project Blob Example written in Objective C
& also tried with Swift & is working as expected. Here is my Swift Example Project.
Just replace your account credentials with respective ones and you are good to go..!!
Note:
Try to use UIImageJPEGRepresentation
instead of UIImagePNGRepresentation
because png takes more size than jpg.
这篇关于如何使用ios的blob存储服务?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!