I have problem with my script, when i try to download ZIP files after creating - apache read them instead of downloading !!!
I use zipstream.php class (https://github.com/maennchen/ZipStream-PHP)
How to configure apache (running on Ubuntu) to let downloading this files with ZIP extension ?
Thank you !
Code i am using:
<?php
if($_GET['download'] == "ok")
{
$id = $_GET['id'];
$content = "TEST";
$mysql = $db_1->query("select result from testing where id='$id'");
$row = mysql_fetch_assoc($mysql);
$content .= $row['result'];
$file_opt = array(
'time' => time() - 2 * 3600,
'comment' => 'Simple Comment !',
);
$zip = new ZipStream('test.zip', array(
'comment' => 'Simple Comment !'
));
$zip->add_file('test.txt', $content, $file_opt);
$zip->finish();
exit;
}
Note: The problem is when i call the file from JQUERY he won't download, but when i browse it directly he download correctly !!