In my project I am creating a excel file and providing user to downlod it by
header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
code. I am triggering file generating code by $(location).attr('href','###'); code in JS so it gives call to file exporting page and after generating file download window appears. For showing work in progress I have displayed loader window when export button clicked before calling $(location) and for closing this window I have used Jquery cookie library (To actualy check when file generation is completed and download window appears) For this I have referred
Detect when browser receives file download
Url this technique solves my problem and I can able to check when progress is completed and removed loader window.
Now I also want to show the progress of file completion. ie. my excel file generating with some 500 rows. So it takes time for generation, I have tried to write progress in cookie like 25% after 100 rows written, 50% after 200 rows written and tried to check that cookie value in JS code
fileProgress = window.setInterval(function () {
var cookieValue = $.cookie('fileProgressToken');
alert(cookieValue)
}, 1000);
but it doesn't work, I found that php set cookie value after page progress completes (ie. when all file generation process completes) and set value as 100 and I am not able to check the progress after 1 second.
What shall I do to achieve this, Does it possible or any simple alternative way