How to compress multiple images and upload in FTP server from iPhone app? - iphone

I am developing iPhone app for take photo and upload the photo in FTP server. From the app i want to compress nearly 25 photos taken by the user and upload the compressed photos in FTP server. Can anyone please guide me to compress the images(Like ZIP) and upload the compressed photos on FTP server. Please help me. Thanks in advance.

You should definitly try out this library -> http://code.google.com/p/objective-zip/ . I've had good results zipping up to 3 images. Guess 25 will work as well
EDIT:
Here's a post of mine which has some sample code wich you can use :)
How can I convert my Zip-file to NSData to email my Zip file as an attachment

Related

.m4a file is not playing while uploading to server

In my app i am uploading .m4a music file from iphone library (storing in core data) which is downloaded from itunes, problem is the uploaded file is not playing (even in browser), some times the uploaded file is of 4MB size, in server it is showing 20KB. If i upload a .mp3 file it is perfectly uploading and perfectly playing. please help me.My code follows like this.
[request addData:[managedobject valueForKey:#"songData"] withFileName:[managedobject valueForKey:#"song_name"] andContentType:nil forKey:#"file"];
[request setPostValue:[managedobject valueForKey:#"song_extension"] forKey:#"extension"];
Try manually uploading the file to your server to verify that it will play at all... because of Apples Fairplay (http://en.wikipedia.org/wiki/FairPlay) DRM, I have had trouble playing songs bought off the store as well. However, if this is not the case, then recheck your upload code because something is wrong.

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.

iphone: coding a data compression or zipping agent?

I'm creating a simple service for uploading photographs from an iphone to a web server.
However, before the requests is sent, I want the app to compress the pictures (custom format or otherwise) in the background before sending it.
Any pointers on how I could go about doing this?
Check out the NSDataCategory posted to CocoaDev. It does exactly what you're looking to do.
http://www.cocoadev.com/index.pl?NSDataCategory
I use ziparchive to unzip content downloaded from a server. It also has functionality to create zip files on an iOS device and might be what you are looking for.
http://code.google.com/p/ziparchive/

Compress Document folder in application sandbox of iphone

I need to compress the Documents folder in the application sandbox and upload the compressed file to a server. I've been able to send files from iphone to the server, but am stuck in regards to compressing the folder. I'm using the ASIHTTPRequest libraries for connecting to the server.
Any body can point me to the right direction. I'd be highly grateful.
Thanks in advance
Nik
You can't alter the Documents folder itself because you don't have permission. However, you can compress files inside it. I pretty sure you can use the command line zlib to do the actual compression. Use NSTask to run it from the apps code.

Accessing the music files in iPhone

I need to build a system which backup and restore system in which all the phone datas
including audio, video, pictures. From iPhone 4.0 , there is support for accessing the videos
and photos from the library . Is there any way to access the music files. I need to convert those music files into binary format . Is there any way to accomplish this...
awaiting for the response
Best Regards,
Mohammed Sadiq.
Mohammed,
Please see the Add Music example on Apple's website:
http://developer.apple.com/iphone/library/samplecode/AddMusic/Introduction/Intro.html
-Rob