Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to use the blob storage service from ios?

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?

like image 623
Ajay Avatar asked Apr 17 '13 21:04

Ajay


People also ask

How do I access blob storage from URL?

By default, the URL for accessing the Blob service in a storage account is https://<your account name>. blob.core.windows.net. You can map your own domain or subdomain to the Blob service for your storage account so that users can reach it using the custom domain or subdomain.


1 Answers

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.

like image 70
Ajay Avatar answered Oct 02 '22 15:10

Ajay