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?
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With