/    Sign up×
Community /Pin to ProfileBookmark

unzip files using php

Hi all

I was wondering if it is possible to unzip zip files using php. Please let me know your thoughts and suggestions. Any help is greatly appreciated.

Thanks

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@scragarFeb 13.2008 — use the exec command and a command line unzip program?

[code=php]exec('unzip -u MYARCHIVE.zip');// add a "-p PASSWORD" if needed.[/code]on linux systems...
Copy linkTweet thisAlerts:
@prachuauthorFeb 13.2008 — Thanks for your reply. But I am on Windows. Any suggestions for that?
Copy linkTweet thisAlerts:
@scragarFeb 13.2008 — there must be command line unzip programs for windows, and the exec function should work on windows(although I've never tried it). Only thing I can suggest is to go search google or something.

sorry.

oh, and exec() runs parallel to PHP, so running unzip might take a while to complete, even after the page has finished being processed, if you want anything in it look into logging something into a text file and reading it (or even just using filesize to check for size changes).
×

Success!

Help @prachu spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...