How can I open/save an music or viddeo fille

Problems with the Windows version of XAMPP, questions, comments, and anything related.

How can I open/save an music or viddeo fille

Postby lunaticbit » 17. July 2015 16:54

My problem is that i have to store all data into a DB tble, and retrieve them later.
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.
lunaticbit
 
Posts: 21
Joined: 09. April 2015 16:24
Operating System: Windows 7

Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 77 guests