poster format in blob

Asked by markus eder

Hi, I'm trying to read the poster data with a php script to retrieve informations using a small php script. I need to know the format (ipeg, png, tiff....) to use the correct
header('Content-Type: image/gif');
settings. Once it's working I can also distribute it. I use it to check my available Videos via my HP-Touchpad and a Webserver on my NAS.

Question information

English Edit question
Griffith Edit question
No assignee Edit question
Solved by:
markus eder
Last query:
Last reply:
Revision history for this message
Michael (mikej06) said :

Griffith doesn't provide the filetype directly with a database field.
You should try to use the fileinfo api of the PECL extensions:

Revision history for this message
markus eder (markus-eder) said :

Thx for the hint but during my investigations how to install/use PECL extension I found my solution. contains a jpeg file. Here my code maybe somone has the same issues.

executing in a php script:

echo "<img src='Bild_Anzeigen.php?mdparam=$postermd'>";

// Posterausgabe md5
  $md5param = $_GET['mdparam'];
   // Datenbank-Datei offnen bzw. erzeugen
    $db = new PDO("sqlite:C:\Temp\griffith.db");
  // Abfrage ausfuehren
        $dbPosters = $db->prepare("SELECT * from posters where md5sum= :MD5nr");
        $dbPosters->bindParam('MD5nr', $eingabe);
        $eingabe = $md5param;
   // Abfrage-Ergebnis ausgeben
   foreach($dbPosters as $row)
    $md5Wert = $row[0];
    $Poster = $row[1];
  Header("Content-type: image/jpg");