I wrote a PHP code for site backup and I am compressing the whole site and allowing the user to download it in his/her machine. The compression and download works fine but since it is a site backup, it is taking some time to zip and download and I don't want the user to navigate to any other page while the zip/download is in progress. Is there any way, I can show a progress bar while zip/download is in progress? I searched in google but it seems that you can show progress bar on upload but not while downloading.
I created a temp file before the zip actually takes place and did a check if the file exists. My logic was if the file exist then display a modal dialog in JS with "please wait.." message but since the download makes use of header, I cannot basically echo anything before download.
Any suggestions?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…