Php: How to handle file processing and download operations in a single script?

Create the zip and then redirect the user to that file php.net/manual/en/function.header.php.

Create the zip and then redirect the user to that file. php.net/manual/en/function.header.php.

Thanks Antonio, but in this case I have to do it in a single process... – Cambiata Aug 23 '09 at 10:55 You are doing it in a single process. You already create the file, just either use the header to pass the appropriate headers to download a file and then use readfile. Or simply redirect the user to the zip file (which is a lot simpler) – AntonioCS Aug 23 '09 at 20:27 IF you do that, then don't forget to implement some kind of solution that deletes files that have already been served.

– Anti Veeranna Aug 24 '09 at 14:20.

Thank you, JorenB and Gumbo! The texteditor examination revealed some debug output in zip creation that doesn't affect the orignial zip, but corrupts the data sent to the browser when downloading.

The downloaded zip is corrupted (filesize is ok though). Processes in two separate script calls, the downloaded zip is ok. Finished before the download starts.

Insert a sleep(3) between the processes... Code outline below. How to assure that the zip file is completely finished before the force download starts?

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions