#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2005
    Location
    Ohio
    Posts
    22
    Rep Power
    0

    unzipping a password protected zip file.


    I'm writing a script in php, but seeing it's on a Mac OS X server, I thought it fitting to ask the question here.

    I can easily ftp the files over to the server, but the difficulty comes in when the I try and unzip the files. The ftp is public, but the archives have passwords.

    I can download them straight to my machine and unzip them no problem. It does prompt for a password and on an xp machine I can extract and view the files without a hitch.

    But I'm having trouble finding a solution to being able to extract them on the server. It's going to be an automated process, so extracting & then uploading them everyday is not a possiblity.

    This is what I get when I do the following:
    unzip -t MF20050718_073402_OFF_1.zip
    --
    Archive: MF20050718_073402_OFF_1.zip
    skipping: MF20050718_073402_OFF_1.txt encrypted (not supported)
    Caution: zero files tested in MF20050718_073402_OFF_1.zip.
    1 file skipped because of unsupported compression or encoding.
    --

    I've tried using the -P [password] switch to no avail.

    Can someone help me out?
  2. #2
  3. (retired)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2003
    Location
    The Laboratory
    Posts
    10,101
    Rep Power
    0
    unzip -P password -t MF20050718_073402_OFF_1.zip ?

    I guess it depends on the version of unzip installed.

    How are you scripting this? Are you the one password protecting the zip files? Is this necessary? Does your_language_of_choice have a zip API (most do)?

    --Simon
    Last edited by SimonGreenhill; July 18th, 2005 at 04:00 PM.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2005
    Location
    Ohio
    Posts
    22
    Rep Power
    0
    unzip -P password -t MF20050718_073402_OFF_1.zip ?

    I just tried that format, and still receive an error.

    I did a unzip -h to check the version, and saw this "UnZip 5.20 of 30 April 1996, by Info-ZIP."

    Considering they are now up to 5.52, I will see if the server admin will be updating it.

    I'm using php with the shel_exec function to do this. The files are retreived from an FTP that is set to allow anon logins. The files are real estate data that will be updated daily. The server we run off from is Mac OS X, and this is the first real time I've run into a big issue with it at all.

    Thanks again for your help.
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2005
    Location
    Ohio
    Posts
    22
    Rep Power
    0
    Found a solution...

    zip/funzip -password archive > directory/file

    Works greeat for what I need it for.

    Thanks again for the help!
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2009
    Posts
    2
    Rep Power
    0
    how to unzip a password protected zipped file???
    please contact if any one can help....please reply....
  10. #6
  11. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2009
    Posts
    2
    Rep Power
    0
    how to unzip a paasword protected zipped file???

    if anyone can help please reply....
  12. #7
  13. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2009
    Posts
    135
    Rep Power
    30
    This thread is 3.5 years old. How about starting a new thread if you have a real question?

    Why do you want to unzip a password-protected file? Unpassword-protect it, and unzip the thing.

    Can't unpassword-protect it? Don't have the password? Don't ask us to hack for you.

    Comments on this post

    • medialint agrees
  14. #8
  15. Expert Debugger
    Devshed Beginner (1000 - 1499 posts)

    Join Date
    Apr 2006
    Location
    Dev Shed Forums (-_^)v
    Posts
    1,022
    Rep Power
    1302
    Originally Posted by cute.jasmeen
    how to unzip a paasword protected zipped file???

    if anyone can help please reply....
    did you tried something ?

    the answer to your query would be as simple as if you are using a windows you can use winzip to extract the password protect file if you know the password
  16. #9
  17. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jan 2009
    Posts
    135
    Rep Power
    30
    Originally Posted by sarav_dude
    did you tried something ?

    the answer to your query would be as simple as if you are using a windows you can use winzip to extract the password protect file if you know the password
    I think on most OSs, you double-click the file and type in the password. Not overly difficult. Not worth posting to a forum, unless she doesn't HAVE the password.
  18. #10
  19. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Mar 2010
    Posts
    1
    Rep Power
    0

    How to unzip password protected zip files on Mac


    Originally Posted by bytbox
    This thread is 3.5 years old. How about starting a new thread if you have a real question?

    Why do you want to unzip a password-protected file? Unpassword-protect it, and unzip the thing.

    Can't unpassword-protect it? Don't have the password? Don't ask us to hack for you.
    Wow - what an ignorant and unpolite poster.

    So anyway, ignoring him, it turns out that as incredible as it seems, even in Snow Leopard, the default zip program is too old to support password protected zip files.

    So on the Mac, you have no choice but to download and install a newer version of zip that supports this. A very nice one is called TheUnarchiver2. You can download it for free e.g. here:

    OK , just Google for it. Version 2.3 was the latest when I wrote this.

    To use it from then on, you just right click on the zip file and choose "The Unarchiver" instead of the default "Unarchiver App". Then it will prompt you for the password. Works like a charm in both Leopard and Snow Leopard.

    Someone really should suggest to Steve Jobs that supporting password supported zip files is kind'uv' basic and important to some people.

    Enjoy!
    - Jeff

IMN logo majestic logo threadwatch logo seochat tools logo