You are invited to Log in or Register a free Frihost Account!

Use php to extract archives

Hello! I'm writing some more stuff for one of my scripts, but I need to work out a way how to make a php archive-extracter which works on php 4/5.

Does anybody have ideas?

Perhaps preg_split could be used.. Confused
Are you talking about being able to unzip a remote file and work with the files that it contained?

I simply put an unzip.exe executable into my cgi-bin directory. From php, I can unzip it and work with the files. You will need to read the full details of how to use and install this on your server :
I mean that this script uses plain out-of-the-box, no-additional-mods, no-compiling-options PHP. This needs to be compatible on all PHP4/5 servers.

Confused Sorry if I didn't previously give you enough information.
I think that I may have misled - I said "From php, I can unzip it and work with the files." but I meant to say "From php, I can then unzip any archive file and work with the files by calling the executable to do the work."

This unzip.exe that I mentioned before may be your best bet -- once the executable is in place, the php calls will work. It really is simple php after the unzip program is on the server. There are versions of this that will run on either Linux or Windows (please read the PHP: Zip File Functions - Manual: and see if it isn't what you need.)

Some hosting services may already provide this unzip library or an alternate compiled library for you to access via PHP or Perl. If not, some may do all of the back-end installations of the unzip.exe for you - to all of your appropriate cgi-bin folders.
As I previously said, this cannot be used.

Linux systems

In order to use these functions you must compile PHP with zip support by using the --enable-zip configure option.

Windows users need to enable php_zip.dll inside of php.ini in order to use these functions.

I need one which works without any of these kind of things.

thats the best they got...
If you mean archive = zip archive Wink try this PEAR package

You can also test, if native zip extension is reachable and use it instead of this code. I mean on many web hosts is zip extension enabled by default.
If you can't install pear package, there is a simple ss_zip.class.php which you can just include in your file and use. I got it from My friends told me that the URL is not working. Just google for it and see if you can download it from alternate location. If not available, pm me your email id. I will mail it to you.
Related topics
[php scripts ] phpweather&email
PHP Help Needed
A Simple Form Mail in PHP
PHP/Blogger error
Indigoperl includes a copy of Apache 2.0.44, PHP 4.2.3, perl
Php sms
SELECTing from MySQL with PHP
Uploading a .php file! NEED HELP thanks
Site redesign
PHP help: Categories > Archives
Checking if user exists, whats wrong?
Free Online FTP
Upload image file problem
learn guitar online
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

© 2005-2011 Frihost, forums powered by phpBB.