Forum Moderators: coopster
A couple of questions:
I'm running a system() command to zip up some files when a user selects a link. The problem is that the browser displays the zipping progress for each file as it loops. How can I prevent that? Better yet... Can I display a simple "compressing files" type message with a "spinner" instead?
Secondly: I then use: header(Location: url/path/filename.zip);
to prompt the user to download the dynamically generated zip file from above. It seems to work great but is there a better way to do this? Any drawbacks?
Thanks for taking the time to consider this.
Regards
Scott
Is it that my question(s) are not concise enough?
I pay the $... Mostly because this site is a WEALTH of information for others... I love this place but I have to wonder..... I don't think I've ever received a solution to my questions on this site. I almost always figure out the answers to my questions on my own... Why bother? I always make an attempt at due diligence... I do search... I do try the obvious... and include my results...
Somebody posts a question regarding the use of a basic conditional statement and gets 4 answers in less than 5 mins. I don't expect the the answer to the meaning of life but I would appreciate a response. Are answers to real problems so proprietary that people here won't post solutions? If so, why should I bother supporting this site?
Regards
Scott
But back to the subject;
Un/zipping files can be done in a much simpler manner with the zip extension [php.net], and that does not have the output anything to the screen, and besides of that, you can generate zip files on the fly, and output it to the browser - without actually storing it in the filesystem. So with the php page you can implement both functions, the zipping and the downloading.
If this is not an option for you, then you should look into the documentation of exec() [php.net], that does the same as system(), with the difference that the output of the command you executed is not dumped to the browser, but placed in a variable.