Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Applications > How Can I zip files in os X?

How Can I zip files in os X?
Thread Tools
ixus_123
Dedicated MacNNer
Join Date: Dec 2002
Location: London, UK
Status: Offline
Reply With Quote
Jun 16, 2007, 04:54 PM
 
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?
iBook G3 366mhz as a web server:
http://kieren.demon.co.uk/wordpress/
     
besson3c
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Jun 16, 2007, 05:05 PM
 
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
     
ixus_123  (op)
Dedicated MacNNer
Join Date: Dec 2002
Location: London, UK
Status: Offline
Reply With Quote
Jun 16, 2007, 06:04 PM
 
that puts them in a folder inside the archive zip
iBook G3 366mhz as a web server:
http://kieren.demon.co.uk/wordpress/
     
besson3c
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Jun 16, 2007, 10:54 PM
 
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...
     
besson3c
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Jun 16, 2007, 11:01 PM
 
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.
     
WJMoore
Grizzled Veteran
Join Date: Jan 2002
Location: Melbourne, Australia
Status: Offline
Reply With Quote
Jun 17, 2007, 12:15 AM
 
Originally Posted by besson3c View Post
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.
     
ixus_123  (op)
Dedicated MacNNer
Join Date: Dec 2002
Location: London, UK
Status: Offline
Reply With Quote
Jun 17, 2007, 02:58 AM
 
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
iBook G3 366mhz as a web server:
http://kieren.demon.co.uk/wordpress/
     
besson3c
Clinically Insane
Join Date: Mar 2001
Location: yes
Status: Offline
Reply With Quote
Jun 17, 2007, 03:03 AM
 
Originally Posted by ixus_123 View Post
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?
     
zro
Mac Elite
Join Date: Nov 2003
Location: The back of the room
Status: Offline
Reply With Quote
Jun 17, 2007, 03:32 AM
 
     
ixus_123  (op)
Dedicated MacNNer
Join Date: Dec 2002
Location: London, UK
Status: Offline
Reply With Quote
Jun 17, 2007, 05:02 AM
 
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
iBook G3 366mhz as a web server:
http://kieren.demon.co.uk/wordpress/
     
   
 
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Top
Privacy Policy
All times are GMT -4. The time now is 05:20 AM.
All contents of these forums © 1995-2017 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.8 © 2000-2017, Jelsoft Enterprises Ltd.,