Wielkie dzięki za pomoc.
Niestety skrypt nie wyświetla obrazków w Internet Explorer.
Czy ktoś może rozwiązać ten problem.
<?php
include("configs/conf.php");
die ("Nie można połączyć się z bazą danych"); die ("Nie można połączyć się z bazą danych");
$sql_grafika = "SELECT * FROM galeria WHERE id = '$pathimg' LIMIT 1";
$obrazek = $row_grafika['obrazek'];
$typ_pliku = $row_grafika['obrazek_mime'];
$nazwa_pliku = $row_grafika['obrazek_name'];
$rozmiar_pliku = $row_grafika['obrazek_size'];
function file_put_contents($n, $d, $flag = false){
$mode = ($flag == FILE_APPEND
|| strtoupper($flag) == 'FILE_APPEND') ?
'a' : 'w'; if ($f === false){
return 0;
}
else {
$bytes_written = fwrite($f, $d); return $bytes_written;
}
}
file_put_contents($filename, $obrazek);
$image_p = imagecreatetruecolor($xsize, $ysize);
$image = imagecreatefromjpeg($filename);
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $xsize, $ysize, $width, $height);
// Jeśli chcesz znać rozmiar nowego obrazka
imagejpeg($image_p, null, $quality);
$file_size = strlen($image_data);
header("Content-type: $typ_pliku"); header("Content-lenght: $file_size"); header("Content-Disposition: attachment; filename = $nazwa_pliku");
?>