Hi I have to place the waiting image as the script take to 15 - 20 second to executes here is the code
session_start();
$exceptionxlsx_array = array();
$exceptionxlsx_array = $_SESSION['exceptionxlsx_array'];
include("impfun.php");
require ('dbconfig.php');
include("pdf.php");
$objimp = new impfun;
if(!empty($exceptionxlsx_array)){
$exception_filename = 'admin/OccurException/existexception.xlsx';
$objimp->makexlsxfile($exceptionxlsx_array,$exception_filename);
}
$filename = $_SERVER["DOCUMENT_ROOT"]."/bi_tracker/admin/OccurException/";
$objimp->Zip($filename, './OccurException.zip');
$filename='OccurException.zip';
$objimp->truncate();
$objimp->delete_file();
//ob_end_clean();
//ob_end_flush();
//ob_flush();
//header_remove();
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Type: application/force-download");
header( "Content-Disposition: attachment; filename=".$filename);
header( "Content-Description: File Transfer");
readfile($_SERVER["DOCUMENT_ROOT"]."/bi_tracker/OccurException.zip");
[
The code wite the xlsx file at teh OccurException directory and after that zip the directory and avail for download
I tried to work with the
<?php
/**
* @author Vivek Tiwari
* @copyright 2012
*/
session_start();
$exceptionxlsx_array = array();
$exceptionxlsx_array = $_SESSION['exceptionxlsx_array'];
include("impfun.php");
require ('dbconfig.php');
include("pdf.php");
$objimp = new impfun;
if(!empty($exceptionxlsx_array)){
$exception_filename = 'admin/OccurException/existexception.xlsx';
$objimp->makexlsxfile($exceptionxlsx_array,$exception_filename);
}
?>
<html>
<body onLoad="init()">
<div id="loading" style="position:absolute; width:100%; text-align:center; top:300px;">
<img src="loading.gif" border=0>
</div>
<script>
var ld=(document.all);
var ns4=document.layers;
var ns6=document.getElementById&&!document.all;
var ie4=document.all;
if (ns4)
ld=document.loading;
else if (ns6)
ld=document.getElementById("loading").style;
else if (ie4)
ld=document.all.loading.style;
function init()
{
if(ns4){ld.visibility="hidden";}
else if (ns6||ie4) ld.display="none";
}
</script>
</body>
</html>
<?php
$filename = $_SERVER["DOCUMENT_ROOT"]."/bi_tracker/admin/OccurException/";
$objimp->Zip($filename, './OccurException.zip');
$filename='OccurException.zip';
$objimp->truncate();
$objimp->delete_file();
//ob_end_clean();
//ob_end_flush();
//ob_flush();
//header_remove();
header("Pragma: public");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Content-Type: application/force-download");
header( "Content-Disposition: attachment; filename=".$filename);
header( "Content-Description: File Transfer");
readfile($_SERVER["DOCUMENT_ROOT"]."/bi_tracker/OccurException.zip");
?>
Thi scode however dispaly the image but gives the warnning cannot modify the header information and did not avail the directory for download
I have also use ob_start(); ob_end_flush();in my script this stop the execution of image however gives the directory for download
as i have to display the image when the script get processed
Sorry for this long message