I want to make a script that creates a zipfile, starts a download (Where the client get's to choose where to save it, as usual) and then deletes the file and returns the client to the staring page.
All this after the client has pressed the "execute button".
I only want to use HTML and PHP, no JAVA / VB script or CGI/Perl.
What I've done so far is to create the zip archive, after that I can either start a download (wich get's a PHP extension on some clients... (even though I'm using Content-Type: application/x-zip-compressed\n header) )
But if I then delete it (unlink), it get's deleted so fast that the client don't get to download it.
I'd really prefer to use some sort of HTML meta tag to initiate download rather than PHP wich I find buggy in the downloading (All these headers...)
I've tried setting
<base target="main"> in the HTML header and then making a auto refresh meta tag to the file, but it still opens in the same window, stopping the script from continuing, and it also has the "to fast deleted" problem...
Any ideas?
To clarify:
- Client presses button.
2 changes to the script page
3 creates zip archive file to a temp directory.
( this is done dynamicly in the script, adding files here and there)
- Start download.
5 return user to start page and delete zip archive and temp directory.
I can do all those parts individually, but not get it to fit together!