|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-08-04 10:58 UTC] sniper@php.net
[2003-08-09 09:36 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 16:00:01 2025 UTC |
Description: ------------ When a PG large object is returned to the web browser from the database using pg_lo_read_all(db resource, object id) the returned object is modified as shown by the unix command cmp. bash-2.05a$ cmp kat_y_justin.jpg kat_y_justin_dl.jpg kat_y_justin.jpg kat_y_justin_dl.jpg differ: char 1, line 1 File sizes are different but not drastically (between original and downloaded object). Size is field number 1 below: 30877 Aug 3 14:37 kat_y_justin.jpg 30884 Aug 3 15:15 kat_y_justin_dl.jpg Reproduce code: --------------- function send_object() { $db = do_db_connect(); cdb_query($db, "begin"); $res = pg_lo_open($db, $_POST['object_id'], 'r'); header("Content-type: " . $_POST['file_type']); header("Content-Disposition: file; filename=" . $_POST['filename']); header("Content-Transfer-Encoding: binary"); pg_lo_read_all($res); pg_lo_close($res); cdb_query($db, "end"); exit(); } cdb_query(db resource, string) is just a SQL wrapper function. Expected result: ---------------- The same large object (which can be retrieved by using command line psql) should be returned to browser. Actual result: -------------- A modified file is returned to the browser.