SitePoint Sponsor |
|
User Tag List
Results 1 to 25 of 45
-
May 31, 2002, 13:02 #1
- Join Date
- Jan 2002
- Location
- Canada
- Posts
- 6,364
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Ziping (or gziping) a folder with PHP?
Is this possible?
If so, how?
Thanks,
~someonewhois- Nathan
-
May 31, 2002, 13:17 #2
- Join Date
- Jan 2002
- Location
- Canada
- Posts
- 6,364
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Actually, zipping (or gzipping) and un-zipping (or un-gziping).
Please help!
Thanks,
~someonewhois- Nathan
-
May 31, 2002, 17:25 #3
- Join Date
- Jan 2002
- Location
- Canada
- Posts
- 6,364
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Is this possible?
- Nathan
-
Jun 1, 2002, 02:49 #4
- Join Date
- Sep 2001
- Location
- Singapore
- Posts
- 5,269
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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...
-
Jun 1, 2002, 03:49 #5
- Join Date
- Jun 2001
- Location
- In your basement
- Posts
- 1,268
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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
-
Jun 1, 2002, 06:04 #6
- Join Date
- Jan 2002
- Location
- Canada
- Posts
- 6,364
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Ok, I checked out the phpManual before posting, and didn't really understand how to use it..
Any examplse?
Thanks,
~someonewhois- Nathan
-
Jun 1, 2002, 12:50 #7
- Join Date
- Sep 2000
- Location
- Halmstad, Sweden
- Posts
- 7,400
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
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
-
Jun 1, 2002, 14:02 #8
- Join Date
- Jan 2002
- Location
- Canada
- Posts
- 6,364
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
I can't find it, can you?
A URL please?
Thanks,
~someonewhois- Nathan
-
Jun 1, 2002, 14:42 #9
- Join Date
- Sep 2000
- Location
- Halmstad, Sweden
- Posts
- 7,400
- Mentioned
- 1 Post(s)
- Tagged
- 0 Thread(s)
Gotta admit, it was very hard to find:
http://www.zend.com/zend/spotlight/c...zip-files1.phpMattias Johansson
Short, Swedish, Web Developer
Buttons and Dog Tags with your custom design:
FatStatement.com
-
Jun 1, 2002, 15:58 #10
- Join Date
- Jun 2001
- Location
- In your basement
- Posts
- 1,268
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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
-
Jun 1, 2002, 16:50 #11
- Join Date
- Jan 2002
- Location
- Canada
- Posts
- 6,364
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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
-
Jun 1, 2002, 19:23 #12
- Join Date
- Jul 2001
- Location
- So. Tenn.
- Posts
- 363
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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.
-
Jun 2, 2002, 06:04 #13
- Join Date
- Jan 2002
- Location
- Canada
- Posts
- 6,364
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
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
-
Jun 2, 2002, 06:24 #14
I *think*:
PHP 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
-
Jun 2, 2002, 06:41 #15
- Join Date
- Jan 2002
- Location
- Canada
- Posts
- 6,364
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Ok, will try!
Thank you,
~someonewhois- Nathan
-
Jun 2, 2002, 07:01 #16
- Join Date
- Jan 2002
- Location
- Canada
- Posts
- 6,364
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Doesn't work..
Any ideas?
Thanks,
~someonewhois- Nathan
-
Jun 2, 2002, 07:07 #17
It will only work on *nix, what did you try it on?
SeanHarry Potter
-- You lived inside my world so softly
-- Protected only by the kindness of your nature
-
Jun 2, 2002, 07:23 #18
Ooops, I thought you were unzipping!
To zip (again I'm not totally sure!):
PHP 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
-
Jun 2, 2002, 07:30 #19
- Join Date
- Jan 2002
- Location
- Canada
- Posts
- 6,364
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Ok, willl try!
Thanks,
~someonewhois- Nathan
-
Jun 2, 2002, 07:38 #20
- Join Date
- Jan 2002
- Location
- Canada
- Posts
- 6,364
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Works, and gunzip is for restoring, I'll need that too.
Thanks,
~someonewhois- Nathan
-
Jun 2, 2002, 07:41 #21
Actually I think you may have to do it like this:
PHP Code:exec( "gzip -d /path/to/file.gz > /path/to/unzip/to" );
SeanHarry Potter
-- You lived inside my world so softly
-- Protected only by the kindness of your nature
-
Jun 2, 2002, 07:45 #22
- Join Date
- Jan 2002
- Location
- Canada
- Posts
- 6,364
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
It creats the gzip, but doesn't add the files to it.
Thanks,
~someonewhois- Nathan
-
Jun 2, 2002, 07:46 #23
- Join Date
- Jan 2002
- Location
- Canada
- Posts
- 6,364
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
-d does the same thing, empty gzip file.
- Nathan
-
Jun 2, 2002, 07:49 #24
-d is to decompress
SeanHarry Potter
-- You lived inside my world so softly
-- Protected only by the kindness of your nature
-
Jun 2, 2002, 07:54 #25
- Join Date
- Jan 2002
- Location
- Canada
- Posts
- 6,364
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Ok, but why doesn't it zip it up like it should?
Thanks,
~someonewhois- Nathan
Bookmarks