Hi Guys,

I am using PHP to zip some files and off them as a download. I am first zipping the files then using a redirect to the location of the zip folder to download. So basically I have in my code:

function to zip files

redirect

What I want to know is, will the PHP script execute my zip files function and wait for it to finish before moving on to my redirect? Or do I have to put in some check to make sure the files have been zipped and then proceed?

I am just worried that my page will redirect before the zipping is finished leaving me with either an unfinished or non-existent zip file.

it should wait for the zip function to finish, but to be on the safe side you might put a loop check in to make sure that the files are zipped, and not to redirect until the are zipped.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.