The content of the php page which is made fro this task is as follows:
- Code: Select all
<?php
$dbtype = "sqlite";
$dbhost = "localhost";
$dbname = "alpha";
$dbuser = "root";
$dbpass = "r00t";
$conn = new PDO("mysql:host=$dbhost;dbname=$dbname",$dbuser,$dbpass);
$sql = "SELECT type,data FROM myfiles WHERE id=".$_GET['id'];
$qry = $conn->prepare($sql);
$qry->execute();
$qry->bindColumn(1, $type);
$qry->bindColumn(2, $data, PDO::PARAM_LOB);
$qry->fetch(PDO::FETCH_BOUND);
header("Content-Type: $type");
echo $data;
?>
Blob types as ms-Word, PDF, TXT, etc and image files of all types (BMP, JPG, PNG, etc) are immediately opened or are asking for SAVE/OPEN when the above module is executed. The problem is how can I use he same code with or without modifications to succeed. Thank you in advance.