If you're using the zip extension, the answer seems to be "no." The close method in the ZipArchive class is what triggers a write, and it seems to want to write to a file. You might have some luck using Streams to simulate a file, but then you're keeping the entire thing in memory, and you still couldn't send it until you're done adding files.
If you're having problems with timeouts or other problems while having a user wait for the zip file to be created, try a multi-step download process:
- User picks whatever they pick to create the zip
- They're taken to a status page that uses ajax calls to actually build the zip file in the background. A pretty, distracting animation should keep their attention.
- After the background processes build the zip, the user is redirected to a script that performs the download / redirected to the file.