Uploading images from iPad in base64 format and size limit - iphone

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.

Related

How to get the EXIF metadata info from a base64 image in Ionic 3?

I am picking an image from android phone gallery using Ionic native Camera plugin which is giving me base64 data which is my requirement for the time. Now, on some mobiles the image picked (base64 data) returns with its orientation rotated. How can I can extract the EXIF information from this base64 image and change its orientation so that I can then send it to the server for uploading.
and I am not looking for the upload code. Just the EXIF info & change orientation part.
Any help is highly appreciated in advance :).
You can use cordova-plugin-camera-with-exif library to get the EXIF metadata
I have used piexifjs to read the Exif data and add geo coordinates to a base64. I bet you can fix the orientation issue using the same plugin. But the plugin itself very memory intensive. It took more than 2 minutes to read the exif data, change, and write again to a base64.

How to download a blob image from java server to iPhone app?

I have created a program which allows me to upload images to Java Server thru Multipart.
How can I receive an image from server and download it to iPhone app? Is there any way apart from NSURL i can download the image?
Base64 Encoding & Decoding seems to be not working.
If what you're downloading is base64 encoded, you can just download it using NSURLConnection. Once you have the data downloaded, base64 decode the data and put it into an NSData that can then be loaded into a UIImage. A solution for doing that can be found here on SO.
No matter what, though, you're going to need NSURL. ASIHTTPRequest provided a Core Foundation networking abstraction that is an alternative to NSURLConnection, however, it's bloated and it is no longer being maintained by the original author (though there are probably some forks that are being maintained).

downloading images from url

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.

How to send png images from iPhone to web service

I have been trying to send .png images from iPhone to web service. I have come so fas as converting the .png image into a byte[] array. I am clueless as to how to use soap or HTTP get/post to transfer the byte[] image to the web service.
Any help would be greatly appreciated.
Sayeed
if you want to use just an HTTP-POST, you can try the ASIHTTPRequest library. it wraps the NSHTTPRequest into an easy-to-use container.
there is also an example how to submit files (your png).

want to know the exact size of a data contend in any specified url

hi all i want to know that while specifying url in my iphone native application for downloading purpose it works fine but if i want to know the exact size of data either in kb or in Mb coming from that url how could i do that plz guide me to do that demonstarting a sample code would be a big boost
thanks
ASIHTTPRequest can request the size of the download for the purposes of attaching a download progress indicator.