Zip class

Small, short code snippets that other people may find useful. Do you have a good regex that you would like to share? Share it! Even better, the code can be commented on, and improved.

Moderator: General Moderators

Sinemacula
Forum Contributor
Posts: 110
Joined: Sat Feb 08, 2003 2:36 am
Location: San Jose, CA

Post by Sinemacula »

I found an email attachments script that does what I want, and is probably better - now I can trigger the script with the zip function in it at regular intervals and have the zipped file emailed to me... set it, and forget it! :lol:
lobos
Forum Newbie
Posts: 3
Joined: Tue Apr 04, 2006 8:32 am

Post by lobos »

Great Class,

Now I have noticed some problems if you use windows XP to compress a file

(eg right click on file -> send to -> compressed (zipped) file)

and then try to extract it with zipextract.cls.php, it throws this error:
Notice: Failed to extract file (0) incompatable file attributes in C:\apachefriends\xampp\htdocs\zipclass\zipextract.cls.php on line 339
This had me stumped for a good hour and I was thinking: why do some .zip work and some not!!!! arrrrggggghhhhh

Anyway it works fine if you compress the files using winace or winzip, but it would be cool if it could some how work with the native windows compression utility as this is so damn quick, basically 2 clicks and you have the archive done.

It is probably worthy noting that this is a big "trap for young players" so it may be worth noting this somewhere conspic....

Thanks for the great class - it is the best one I have found, and the easiest to implement with exiting systems.

-Lobos
redmonkey
Forum Regular
Posts: 836
Joined: Thu Dec 18, 2003 3:58 pm

Post by redmonkey »

Hmmm, any chance you could send me a couple of sample .zip files created with XP's native compression utility?

It's entirely possible I've not accounted for an entirely feasible/legitamate file attribute flag, or it could be that XP is using some odd flag within the attributes. Either way, I currently don't have access to an XP machine, so could really do with some sample data to work with and have a look at what the difference is between XP's and PK's compression formats.
lobos
Forum Newbie
Posts: 3
Joined: Tue Apr 04, 2006 8:32 am

Post by lobos »

Hi I have made some xp samples and sent the links to you via PM.

Please keep us updated :)

-Lobos
redmonkey
Forum Regular
Posts: 836
Joined: Thu Dec 18, 2003 3:58 pm

Post by redmonkey »

Thanks,

I'll keep you updated with any findings.
redmonkey
Forum Regular
Posts: 836
Joined: Thu Dec 18, 2003 3:58 pm

Post by redmonkey »

A combination of my misreading the .zip file format spec and XP's compression util following the spec more closely than the majority of other compression utils.

I've PM'd you a download link to the revised extraction class.
lobos
Forum Newbie
Posts: 3
Joined: Tue Apr 04, 2006 8:32 am

Post by lobos »

Thanks for the prompt update, it now works fine :)

-Lobos
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

redmonkey wrote:A combination of my misreading the .zip file format spec and XP's compression util following the spec more closely than the majority of other compression utils.

I've PM'd you a download link to the revised extraction class.
Could you post the new code here.

Interested myself.

Thanks
redmonkey
Forum Regular
Posts: 836
Joined: Thu Dec 18, 2003 3:58 pm

Post by redmonkey »

Given that it's actually the extraction class, I'll update the code contained with the actual relevant thread a bit later today.
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

Okay, thanks :)
redmonkey
Forum Regular
Posts: 836
Joined: Thu Dec 18, 2003 3:58 pm

Post by redmonkey »

Extraction class source has been updated on relevant thread
User avatar
dibyendrah
Forum Contributor
Posts: 491
Joined: Wed Oct 19, 2005 5:14 am
Location: Nepal
Contact:

good class

Post by dibyendrah »

good work! Finally I found the zip creation class. Is there any alternate class which can create and extract the zip class as well ? I'll search in this forum too...

Cheers,
Dibyendra
redmonkey
Forum Regular
Posts: 836
Joined: Thu Dec 18, 2003 3:58 pm

Post by redmonkey »

If you haven't found it already, the complimentary extraction class can be found here.
evilernie
Forum Newbie
Posts: 12
Joined: Sun Dec 03, 2006 10:43 pm

Post by evilernie »

ok so what do i do if i want to back up the entire public_html folder and everything in it
if i set zip_dir to public_html i get the Warning: chdir(): No such file or directory (errno 2) in /home/tstprogr/public_html/backupZip.php on line 24
Post Reply