Zip timeout

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
fistuks
Forum Newbie
Posts: 4
Joined: Wed May 12, 2010 4:10 am

Zip timeout

Post by fistuks »

Hello,

It there a way to make a progress indicator for a zipping in PHP?
User avatar
Chalks
Forum Contributor
Posts: 447
Joined: Thu Jul 12, 2007 7:55 am
Location: Indiana

Re: Zip timeout

Post by Chalks »

It's difficult to make a progress monitor for _anything_ in php... because php is executed serverside and not clientside. Your best bet would be to make a javascript progress indicator that indicates how long something will take based on previous experience.

For instance: measure how long it takes to zip 10 files, 50 files, 100 files each 5000 times. Take the average time. Now, when a user tries to zip these files up, guess about how long it will take, and have your javascript loader-bar indicate this. Just make sure it doesn't get to 100% complete when it's not actually complete.

At least, that's how I would accomplish this.
fistuks
Forum Newbie
Posts: 4
Joined: Wed May 12, 2010 4:10 am

Re: Zip timeout

Post by fistuks »

Thanks for the answer.
The thing is,
That sometimes i need to zip a large number of files, and by the time $zip->close() finish, i get a browser timeout.
That's why i want to keep echoing while zipping.
Any ideas?...
Post Reply