downloading images from url - iphone

How to download images programmatically in iphone and to store the in image library . I am able to download single image and to store it in iphone library from a web url. How to do that with multiple images.my aim is just to download images (multiple images ) from url and to save it in photo library.

I think your single Url contain a Xml or json response and you have to parse that..other wise using single url you cant fetch multiple data..Any way refer this..Custom Url connection

How can it be possible, by using one URL, you can see only one image in browser. The same way your code will also work. For multiple images, zip them on server, download that zip, extract on your device and add to library.
Else create as many url requests as number of images to download.

Related

How do I enable BPG decoding in ownCloud?

ownCloud does not display BPG images by default, offering to download them instead.
How do I add BPG support to ownCloud using the decoding JavaScript?
The slideshow component of the Files app is actually contained in a 3rd party app and it needs to support the format for you to be able to view those files.
Gallery has an issue to track the implementation of the format
https://github.com/owncloud/galleryplus/issues/185
You won't be able to see thumbnails in the Files app, but you'll be able to view those files when clicking on them.

External Storage

I am developing an app where i have thousands of images i am reading from the sdcard. I would like to say when i deploy the app, the images are downloaded together with the app. I have been trying to find a solution to this but no help. Please help!!!
The images are used as bitmap resources for imageViews. the are too many that I can't put them in drawable because they will make the app size too big.
Right now i have manually copied them over to the storage of the device i am accessing them from there. If I want to test thye app on another device then i have to copy the images folder again to the external drive of that device. Is there a way i can include them in the solution without putting them in drwable
I would suggest to keep your images on some web server and try to download the images from here.This will avaoid coping images all the time to devices .
So here is what you can do :
1 ) Upload the images on some server .
2) Also you can have a xml which will have urls of all the image.
3) When you start your application you first fetch the XML and get the urls.
4) then using these urls you can lazy load the images in your app.
try to read and understand this concept here :
Thanks

Uploading images from iPad in base64 format and size limit

We are developing a inspection application for iPad, where user can select multiple images from iPad and upload this images to portal, also he can enter comments on each particular image.
We are using xml for communication and converting images into base64 string format and uploading to server.
When xml size reaches around 2 MB, at the server side xml is not received and tomcat server returns Null Pointer Exception.
It will work fine if xml size is less than 2 MB.
So i would like to know is converting images to base64 is a proper way to upload images to server?
Is there any size limit for uploading data from iPad/iPhone Application?
Any help is really appreciated.
hi just compress your image
NSData *imageData = UIImageJPEGRepresentation(theImage, 0.1f);
This compress your image and then convert it to base64..
Use ASIHTTP framework for uploas an image from mobile to server
use the below link for how to upload image
http://allseeing-i.com/ASIHTTPRequest/How-to-use don't forgot to add asihttp framewok to your app
We have used PUT for HTTPMethod instead of POST and it worked properly, But I am not sure if there are any disadvantage of using PUT.

Get an image from photo library and upload it to web service by name and path

I am creating a web service based iphone application in which a certain place i need to post an image on to the web for which i want to select image from photo gallery of phone and then i need to get the name and the path of the image on textfield and then uploading of the image.
or when pressing the browse button image picker will show all the image of the iphone and by selecting image it will return its path and name by which we can upload it.
Please check the similar question first.
To fully understand the answer you should also need to read UIImagePickerController Class Reference and ASIHTTPRequest documentation
As ASIHTTPRequest library is not supported more by its author, you may use another open source solution - AFNetworking or even the Cocoa classes, described in the URL Loading System Programming Guide

Downloading Video on iPhone using SDK

I would like to develop such iphone application that provides functionality to download viedo. i am doing some as below
1) Loading HTML content on web view
2) The loaded html content contains the video link (i.e http://test.com/test.mp4")
3) When i click on that it will play the video in native player.
4) but i would like to prevent this thing and start downloading video from that URL
for example, if i click on link it should not open native video player, it should start downloading from that url and store somewhere on iphone (i.e document directory)
is there any solution for same?
Thanks
Vivek
You should use UIWebViewDelegates webView:shouldStartLoadWithRequest:navigationType: method to decide whether or not to load a URL.
You can check the request, and perform some logic, for instance, checking if the URL's suffix is 'mp4' and if so, do something other than load the request in the webview.
You can intercept the mp4 urls, and then hand them off to another method in your controller that will kick off an NSURLRequest to download the video data.
Once you have the video data, you can write it to the documents directory.