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

Re: How can I open/save an music or viddeo fille

Postby scofficial » 20. April 2019 10:33

i was having similar question..can anyone provide solution??
thanks in advance!
scofficial
 
Posts: 1
Joined: 19. April 2019 12:40
XAMPP version: xampp version 3.2.2
Operating System: linux

Re: How can I open/save an music or viddeo fille

Postby Nobbie » 21. April 2019 17:21

Simply embbed it in appropriate HTML5 Tags. For example:

Code: Select all
<html>
<body>
<video controls>
  <source src="http://www.domain.com/scriptname.php?id=4711" type="video/mp4">
</video>


Same for Audio:

Code: Select all
<html>
<body>
<audio controls>
  <source src="http://www.domain.com/scriptname.php?id=4711" type="audio/mpeg">
</audio>
Nobbie
 
Posts: 13165
Joined: 09. March 2008 13:04


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 115 guests