5 Jappix - An open social platform
6 This is the PHP script used to download a chat log
8 -------------------------------------------------
12 Last revision: 27/05/11
17 define('JAPPIX_BASE', '..');
19 // Get the needed files
20 require_once('./functions.php');
21 require_once('./read-main.php');
22 require_once('./read-hosts.php');
24 // Optimize the page rendering
28 // Not allowed for a special node
29 if(isStatic() || isUpload())
32 // Send the HTML file to be downloaded
33 if(isset($_GET['id']) && !empty($_GET['id']) && isSafe($_GET['id'])) {
34 // We define the variables
35 $filename = $_GET['id'];
36 $content_dir = '../store/logs/';
37 $filepath = $content_dir.$filename.'.html';
39 // We set special headers
40 header("Content-disposition: attachment; filename=\"$filename.html\"");
41 header("Content-Type: application/force-download");
42 header("Content-Transfer-Encoding: text/html\n");
43 header("Content-Length: ".filesize($filepath));
44 header("Pragma: no-cache");
45 header("Cache-Control: must-revalidate, post-check=0, pre-check=0, public");
49 // We delete the stored log file