COMPUTER_SC_STUDENT
asked on
Zip files & PHP
How can I zip and unzip files using php ... Can any one give me a simple code plz
Thank you in advance,
Thank you in advance,
one solution would be to use COM (if your server is windows)
another would be to use the OLE class form pear(go to http://pear.php.net/ and search for OLE)
another would be to use the OLE class form pear(go to http://pear.php.net/ and search for OLE)
... sorry I've posted to the wrong question
uhm....sorry for wrong post too. it happened same with me...sound the id numbering make the wrong post when there is new thread come in??
ASKER
I need a complete code plz for openning a Microsoft Word document which already exist ....
I am new in php plz give me a direct answer plz ....
I am new in php plz give me a direct answer plz ....
for 20 points ?!? :)
Please don't create more confusion than needed. This thread is about zip files, this one http:Q_20961487.html is about word files (not "world" *laughing*).
unzipping files in PHP:
system("unzip -a -q yourfile.zip");
unzipping files in PHP:
system("unzip -a -q yourfile.zip");
ASKER
<?php
system("unzip -a -q word.zip");
?>
I tried this code but my file "word.zip" still zipped ...
Are you sure that is the code :)
system("unzip -a -q word.zip");
?>
I tried this code but my file "word.zip" still zipped ...
Are you sure that is the code :)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
1. Are you sure you have the "unzip" command? Try specifying the full location to it
How I can check if I have it or not plz let me know...
2 & 3 is ok .... but 1 I could not check
How I can check if I have it or not plz let me know...
2 & 3 is ok .... but 1 I could not check
this should give you a clue:
<?php
system("unzip --help 2>&1");
<?php
system("unzip --help 2>&1");
<?
$filename = "world.txt";
$fp = fopen($filename, "r");
$buf = fread($fp, filesize($filename));
echo $buf;
?>
hope can help.