uploading compressed files (.zip, .tar, .gzip, etc.)
Moderator: General Moderators
uploading compressed files (.zip, .tar, .gzip, etc.)
I wish to know if there is a way to upload a compressed text file such that as it is uploaded, be able to uncompress it via php and manipulate the text files in order to read data and update database with that data. I came with this when I learned that phpMyAdmin can upload compressed .sql files and then restore a mysql database in seconds. Can anybody give me code examples, etc? Any help will be appreciated.
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
- Chris Corbyn
- Breakbeat Nuttzer
- Posts: 13098
- Joined: Wed Mar 24, 2004 7:57 am
- Location: Melbourne, Australia
Skara,
There's the module ZZipLib for PHP. Then there's also a class ~redmonkey posted in snippets (although I haven't looked at it to check it's for what you need). I guess hotscripts or phpclasses would turn up something too.
BUT, failing those two, you could always just run the unzip command from passthru(), exec() or system() if the only purpose is to physically unzip a file.
There's the module ZZipLib for PHP. Then there's also a class ~redmonkey posted in snippets (although I haven't looked at it to check it's for what you need). I guess hotscripts or phpclasses would turn up something too.
BUT, failing those two, you could always just run the unzip command from passthru(), exec() or system() if the only purpose is to physically unzip a file.
yeah, I tried using exec() and got permission denied no matter what I did... 777'd every single file in the neighborhood even. O.o
redmonkey's class is just for zip files, as is ZZipLib, if I'm not mistaken.
Found something on phpclasses, though: http://www.phpclasses.org/browse/package/945.html
^_^
redmonkey's class is just for zip files, as is ZZipLib, if I'm not mistaken.
Found something on phpclasses, though: http://www.phpclasses.org/browse/package/945.html
^_^
- Ambush Commander
- DevNet Master
- Posts: 3698
- Joined: Mon Oct 25, 2004 9:29 pm
- Location: New Jersey, US