|
|
How Can I zip files in os X?
|
|
|
|
Dedicated MacNNer
Join Date: Dec 2002
Location: London, UK
Status:
Offline
|
|
I'm trying to zip 177 photos to upload to a webserver - thing is os X insists on creating a directory inside the zip file for the jpg files.
I've tried make archive & zip from the command line but both make directories - how do I just dump the files without having a directory made?
|
|
|
|
|
|
|
|
|
Clinically Insane
Join Date: Mar 2001
Location: yes
Status:
Offline
|
|
Select them all in the Finder and do a "create archive" from the contextual menu appear that appears when you have them all highlighted/selected
|
|
|
|
|
|
|
|
|
Dedicated MacNNer
Join Date: Dec 2002
Location: London, UK
Status:
Offline
|
|
that puts them in a folder inside the archive zip
|
|
|
|
|
|
|
|
|
Clinically Insane
Join Date: Mar 2001
Location: yes
Status:
Offline
|
|
So you want a separate zip file made for each file? You could do this in the terminal pretty easy with a single command, but not through the GUI...
|
|
|
|
|
|
|
|
|
Clinically Insane
Join Date: Mar 2001
Location: yes
Status:
Offline
|
|
Here is how you would do this in the terminal:
1) cd into the directory where the jpgs reside
2) for i in *.jpg; do /usr/bin/zip $i.zip $i; done
This will zip all jpgs in the directory you moved into.
Also:
for i in *.jpg; do /usr/bin/zip -r $i.zip $i; done
Should zip all files in the folders in this directory too.
|
|
|
|
|
|
|
|
|
Grizzled Veteran
Join Date: Jan 2002
Location: Melbourne, Australia
Status:
Offline
|
|
Originally Posted by besson3c
So you want a separate zip file made for each file? You could do this in the terminal pretty easy with a single command, but not through the GUI...
I don't think ixus_123 is after individual zip files.
The create archive option doesn't put the files in a folder if you do what besson3c said in the first reply. It will most likely create a __MACOSX folder with the resource forks of the files though.
If you extract the zip file the Finder produces by double clicking it, it will put all the files in a folder with the same name as the zip file. This is to do with the BOMArchiveHelper app and not the zip file itself.
|
|
|
|
|
|
|
|
|
Dedicated MacNNer
Join Date: Dec 2002
Location: London, UK
Status:
Offline
|
|
Hi, Thanks for getting back to me so quickly
I'm slow replying because I went to bed in the mean time.
What I want to do is place 177 photos in one zip file the structure of which will be something like this:
pics.zip / 001.jpg 002.jpg 003.jpg etc
What I get both from command line & os X's menu archive feature is a directory inside the zip file:
pics.zip / pics / 001.jpg 002.jpg 003.jpg etc
in this format the picture gallery can't access the jpgs (I know, I know - a bit rubbish - personally I use Gallery2 and this wouldn't be a problem but this isn't my server)
I tried the instructions above but don't think I understand them fully. WOW! I didn't realise "for" was a command - that's pretty cool. That worked but with each file in a single zip - I need to get all files in on zip - that would be great if you could show me how to do that.
Thanks
|
|
|
|
|
|
|
|
|
Clinically Insane
Join Date: Mar 2001
Location: yes
Status:
Offline
|
|
Originally Posted by ixus_123
Hi, Thanks for getting back to me so quickly
I'm slow replying because I went to bed in the mean time.
What I want to do is place 177 photos in one zip file the structure of which will be something like this:
pics.zip / 001.jpg 002.jpg 003.jpg etc
What I get both from command line & os X's menu archive feature is a directory inside the zip file:
pics.zip / pics / 001.jpg 002.jpg 003.jpg etc
in this format the picture gallery can't access the jpgs (I know, I know - a bit rubbish - personally I use Gallery2 and this wouldn't be a problem but this isn't my server)
I tried the instructions above but don't think I understand them fully. WOW! I didn't realise "for" was a command - that's pretty cool. That worked but with each file in a single zip - I need to get all files in on zip - that would be great if you could show me how to do that.
Thanks
From the zip manpage:
The simplest example:
zip stuff *
creates the archive stuff.zip (assuming it does not exist) and
puts all the files in the current directory in it, in compressed
form (the .zip suffix is added automatically, unless that ar-
chive name given contains a dot already; this allows the
explicit specification of other suffixes).
How are you using the zip command line tool?
Have you tried confirming what an earlier poster is saying and unzipping your archive with a tool other than the BomArchiveHelper thing?
|
|
|
|
|
|
|
|
|
Mac Elite
Join Date: Nov 2003
Location: The back of the room
Status:
Offline
|
|
|
|
|
|
|
|
|
|
|
Dedicated MacNNer
Join Date: Dec 2002
Location: London, UK
Status:
Offline
|
|
Hi Sorry - I missed all of those posts
I was using Safari & I think it did it's old trick of loading the web page from it's cache so I didn't get the newer replies.
Thanks so much guys - it works perfectly now. I didn't realise that it was an OS helper app that created the directory.
It appears I was also making an error in the way I was uploading the pics to the host server - it wants a 'save & exit' rather than 'save and continue'.
Pics are up I'm happy - for what it's worth you can view them here
http://parkrun.com/Default.aspx?tabid=176 (go into the folder for 16th June / Kieren's pics
They are pics I took at a local race run every saturday - totally free, run by volunteers.
Thanks again
- Kieren
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|