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.
Related
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
I want to implement a backup feature in the app I'm working on, that simply puts an image and some data in a folder that can be accessed through itunes or similar.
But is this possible, and what can be done?
Point of the feature is that if (for some reason) the image and data isn't sent to my server, the user will have the ability to extract it to a pc/mac, so that the image and data isn't lost.
Any help is appreciated.
Enabled iTunes file sharing in your app's settings and then write your file to the Documents folder in your app. This will then allow them to see the file through iTunes.
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?
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/
how do i do a HTTPRequest and then save the File locally into the iPad/iPhone.
Im working with the simulator right now so is it possible to emulate the local data storage?
Yep, this is really easy to do, and I wrote another answer on how to do it: How to download files directly to disk on the iPhone os?
ASIHTTPRequest might also come in handy here as an intelligent wrapper to HTTP functionality:
http://allseeing-i.com/ASIHTTPRequest/