Actually it's quite simple as it turned out (I used a basic W3School tutorial go get what I needed).
In case some one will look for the same thing:
you create 2 files - 1st is an html with ajax code in it, 2nd is the actual code creating files.
in first file you put something like this:
<html>
<head>
<script type="text/javascript">
function loadPHPfile()
{
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
//onreadystatechange function
//possible states:
// 0-request not initialised, 1-server connection established
// 2-request received, 3-processing request, 4-request finished & resonse ready
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==1)
{
document.getElementById("myDiv").innerHTML='connection established';
}
if (xmlhttp.readyState==2)
{
document.getElementById("myDiv").innerHTML='Received';
}
if (xmlhttp.readyState==3)
{
document.getElementById("myDiv").innerHTML='Processing';
}
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById("myDiv").innerHTML='Files created succesfuly :)';
}
}
//location of you php code file
xmlhttp.open("GET","export.php",true);
xmlhttp.send();
}
</script>
</head>
<body onload="loadPHPfile()">
<div>Connection status: <span style="color: blue" id="myDiv"></span></div>
</body>
</html>
the way i did it the page returns status of your current request, from received, through processing, up until ready.