store in bytea

From: "Ben-Nes Michael" <miki(at)canaan(dot)co(dot)il>
To: <pgsql-general(at)postgresql(dot)org>
Subject: store in bytea
Date: 2001-08-23 11:46:47
Message-ID: 007e01c12bc9$4a65f020$aa5796d4@canaan.co.il
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi

Im using php to upload Binary data into bytea field.
The problem is that when I query what I uploaded I discover that it hold
only 13 characters and not the whole binary file

I tried manual insert more the 13 characters successfully.
I tried to do addslashes($data);

but still :(
$slashed_data = addslashes($data);
$sql = "insert into files (image_id, bin_data, filename, filesize, filetype)
values ('$image_id', '$slashed_data', '$new_name', '$filesize',
'$filetype');";

I tried strlen($slashed_data); before the insert to be sure that that the
binary is bigger then 13 characters and yes, its 4KB ( the tested file );

Any ideas ?

--------------------------
Canaan Surfing Ltd.
Internet Service Providers
Ben-Nes Michael - Manager
Tel: 972-4-6991122
http://sites.canaan.co.il
--------------------------

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Albert Reiner 2001-08-23 12:12:32 Re: [NOVICE] protected ON DELETE CASCADE
Previous Message Oliver Elphick 2001-08-23 11:40:51 Re: SELECT FOR UPDATE