Is this possible?
If so, how?
Thanks,
~someonewhois
| SitePoint Sponsor |
Is this possible?
If so, how?
Thanks,
~someonewhois
- Nathan
Actually, zipping (or gzipping) and un-zipping (or un-gziping).
Please help!
Thanks,
~someonewhois
- Nathan
Is this possible?
- Nathan
i dunno about the built-in functions but you can always run gzip using an exec or backticks...
if your host doesn't allow that, the function reference should help i guess...





Im pretty sure you can use the default gz functions in php to do it, mind you that the user must have zlib enabled, or you or going to have to include zlib.dll and zlib.so ( might be php_zlib ) with your script and use the dl() function ( which can also be turned off by hosts ).
Hope that helps.
Eric Coleman
We're consentratin' on fallin' apart
We were contenders, now throwin' the fight
I just wanna believe, I just wanna believe in us
Ok, I checked out the phpManual before posting, and didn't really understand how to use it..
Any examplse?
Thanks,
~someonewhois
- Nathan
I believe Zend has a tutorial on how to use it - it's pretty goddamn advanced, though.
Mattias Johansson
Short, Swedish, Web Developer
Buttons and Dog Tags with your custom design:
FatStatement.com
I can't find it, can you?
A URL please?
Thanks,
~someonewhois
- Nathan
Gotta admit, it was very hard to find:
http://www.zend.com/zend/spotlight/c...zip-files1.php
Mattias Johansson
Short, Swedish, Web Developer
Buttons and Dog Tags with your custom design:
FatStatement.com





I haven't really gotten to far with this, I seen a script that used it a bit with a database dump to keep the size down..
Eric Coleman
We're consentratin' on fallin' apart
We were contenders, now throwin' the fight
I just wanna believe, I just wanna believe in us
Ok, but how do I use that to zip it up?![]()
I'm really confused with that...
Thanks,
~someonewhois
P.S. How can I use the gzopen and those functions?
- Nathan


If the script is not for distribution, and just in use on your own machine, couldn't you just install a zip program that supports command line options and run it via the PHP script with system()? Just a thought..
Mr Vector
High quality, royalty free, vector graphics
for t-shirt artists and graphic/web designers.
Couple things:
1. I have no access to command line.
2. It's for public use..
3. That's about it, thanks for trying though!
Thanks,
~someonewhois
- Nathan
I *think*:
SeanPHP Code:exec( "gunzip /path/to/dump/file.gz > /path/to/unzip/to" );
![]()
Harry Potter
-- You lived inside my world so softly
-- Protected only by the kindness of your nature
Ok, will try!
Thank you,
~someonewhois
- Nathan
Doesn't work..
Any ideas?
Thanks,
~someonewhois
- Nathan
It will only work on *nix, what did you try it on?
Sean![]()
Harry Potter
-- You lived inside my world so softly
-- Protected only by the kindness of your nature
Ooops, I thought you were unzipping!
To zip (again I'm not totally sure!):
SeanPHP Code:exec( "gzip /path/to/folder > /path/to/zip/to/file.gz" );
![]()
Harry Potter
-- You lived inside my world so softly
-- Protected only by the kindness of your nature
Ok, willl try!
Thanks,
~someonewhois
- Nathan
Works, and gunzip is for restoring, I'll need that too.
Thanks,
~someonewhois
- Nathan
Actually I think you may have to do it like this:
gunzip is just an alias for gzip so it should not matter which you usePHP Code:exec( "gzip -d /path/to/file.gz > /path/to/unzip/to" );
Sean![]()
Harry Potter
-- You lived inside my world so softly
-- Protected only by the kindness of your nature
It creats the gzip, but doesn't add the files to it.
Thanks,
~someonewhois
- Nathan
-d does the same thing, empty gzip file.
- Nathan
-d is to decompress
Sean![]()
Harry Potter
-- You lived inside my world so softly
-- Protected only by the kindness of your nature
Ok, but why doesn't it zip it up like it should?
Thanks,
~someonewhois
- Nathan
Bookmarks