iphone: coding a data compression or zipping agent? - iphone

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/

Related

Sample code for file upload resuming on iOS?

I have an iOS app where the user has the capability to upload video. I'd like to be able to support the resuming of uploads for when an upload is interrupted by the network, user, or any other circumstance. I realize this will require changes both on the client and server-side. I was wondering if anyone could point me in the right direction for sample code and/or documentation I can read for clues in how to support this functionality? Something with clues on proper chunking, figuring out what chunk was last sent after an interrupted connection, etc.
See ASIHTTPRequest for this. It is a great replacement library for anything network.
See ASIHTTPRequest documentation
Or
you can download sample code here
1 - How can I upload a photo to a server with the iPhone?

picking a file from the memory of iphone?

i am making a client server program for iphone communication with the sever i want to know
that how can i pick a file (jpg, 3gp, bmp or some word document ) from the memory of the
iphone and send it to the server please explain in some detail as i m new in iphone
programming and give some code for it if possible, and how can i convertv an adobe reader and
msword compatible file to jpg file.
Slow down there buster.
There is no "memory of the iPhone." You'll have to get that file in somehow besides a traditional file system. There are ways to send files to other apps… check the docs. To start with, why don't you bundle in a couple files with your .app to test with.
Once you have the file, use something like the ASIHTTPRequest library (google it) to send it to the server.
Clear?

getting data from server and store in the iPhone

i want to develop an iPhone app where the app downloads data (say audio clips) from a specified server and stores it locally on the device.
then the app should use the data stored in the device rather than stream it from the server.
could anybody give me the guidelines as to how this can be done? tutorials and samples also appreciated. Thanks :)
The easiest way to play files from the internet is to use -[AVAudioPlayer initWithContentsOfURL:error:]. If you want to make sure that the whole file is downloaded, I think your best bet would be to download the file using NSURLConnection (see the URL Loading Guide) and then using -[AVAudioPlayer initWithData:error:].
Look into ASIHTTPRequest, you will find it much easier to fetch large chunks of binary over the web asynchronously than if you try to code everything yourself.

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.

Reading iTunesMovies file in iPhone?

In iPhone, the iPod app saves the media files (audio, video) with strange names and in weird folders (F00,F01 etc). There is a file named iTunesMovies in iPhone, which contains all the information about the metadata of those video files and how they are to be displayed in iPod app. I copied that to my Mac also, and when i tried to open that file in textEdit, it showed some alien characters which made me believe that it is encrypted may be(Thats just a wild guess).
I want to read/change the contents of that iTunesMovies file. Can i do that? Is there any Framework which deals with that iTunesMovies file?
Thanks in advance
I don't think there's a framework to do this, but you can probably do it yourself by reading the file into an NSData object, then manipulating how you would like. Your app will have to be running outside the sandbox, as well. Something I don't know how to do.
Keep in mind that this isn't allowed by Apple, so any apps you make that use this would have be distributed through other means.