Patrick Hatcher schrieb: > $row = pg_fetch_array($result); > $type = "JPG"; > Header( "Content-type:$type"); > echo $row[0]; For most browsers that's enough, at least some versions of InternetExplorer need more information: $data = $db->bytea_decode($db->f("data")); header(sprintf("Content-type: %s", $db->f("type"))); header(sprintf("Content-Disposition: attachment; filename=%s", $db->f("name"))); header(sprintf("Content-length: %s", strlen($data))); print($data);