001
03.08.2003, 15:00 Uhr
mike
Pinguinhüpfer (Operator)
|
Und Konqueror:
PHP 4: |
<?php $id = $_GET['blobid']; $conn = pg_Connect("host=localhost dbname=scmaindb user=postgres password=honda" ); $rs = pg_exec($conn, "SELECT blobdata,filename FROM tblthreaddata WHERE blobid = $id;"); $rowcount = pg_NumRows($rs);
$file = pg_Fetch_Array($rs, 0); $row = pg_fetch_row($rs, 0);
pg_exec($conn, "BEGIN"); $loid = pg_loopen($conn, $row[0], "r");
header ("Content-disposition: filename=\"$file[filename]\""); header("Content-type: application/download");
pg_loreadall($loid); pg_loclose($loid);
pg_exec ($conn, "COMMIT");
pg_Close($conn); ?>
|
Aufruf:
PHP 4: |
$query = "SELECT * FROM tblthreaddata WHERE threadid = $thread[oid];"; $result = pg_Exec($query); $rowcount = pg_NumRows($result); $index = 0; while ($index < $rowcount) { $files = pg_Fetch_Array($result, $index); $url = "downloadblob.php?blobid=" . $files['blobid']; echo "<a href=$url>$files[filename]</a>"; echo "<BR>"; $index++; }
|
Danke im Voraus!!! mfg --
Dieser Post wurde am 03.08.2003 um 15:02 Uhr von mike editiert. |