July 18th, 2005, 01:23 PM
-
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?
July 18th, 2005, 02:54 PM
-
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 03:00 PM.
July 19th, 2005, 08:10 AM
-
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.
July 19th, 2005, 02:24 PM
-
Found a solution...
zip/funzip -password archive > directory/file
Works greeat for what I need it for.
Thanks again for the help!
January 22nd, 2009, 09:55 PM
-
how to unzip a password protected zipped file???
please contact if any one can help....please reply....
January 22nd, 2009, 09:57 PM
-
how to unzip a paasword protected zipped file???
if anyone can help please reply....
January 22nd, 2009, 10:25 PM
-
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
January 22nd, 2009, 10:46 PM
-
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
January 23rd, 2009, 08:50 AM
-
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.
March 22nd, 2010, 07:51 PM
-
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