samedi 25 octobre 2014

Jquery and call php page with headers


Vote count:

0




I use the function of jquery called "load" , for call page in php with this code for download one file , but give me errors , etc


The code i call form load function of jquery it´s this ( file name :zipper.php):



header('Pragma: public');
header('Expires: 0');
header('Cache-Control:must-revalidate,post-check=0,pre-check=0');
header('Last-Modified:'.gmdate('D, d M Y H:i:s',filemtime('./tmp/'.date("d-m-Y-H-i-s").'.zip')) . ' GMT');
header('Content-Type: application/force-download');
header('Content-Disposition: inline; filename="./tmp/'.date("d-m-Y-H-i-s").'.zip"');
header('Content-Transfer-Encoding: binary');
header('Content-Length:'.filesize('./tmp/'.date("d-m-Y-H-i-s").'.zip'));
header('Connection: close');
readfile('./tmp/'.date("d-m-Y-H-i-s").'.zip');


I call this file for example from this link :



<a href="#" onclick="jQuery('#down').load('zipper.php');">Download</a>


<div id="down"></div>


But only load and get rarous symbols and nothing more , if don´t use jquery down the file perfectly but i want use jquery for call this file and get the same time but no works


Thank´s for the help , regards



asked 3 mins ago







Jquery and call php page with headers

Aucun commentaire:

Enregistrer un commentaire