Page 1 of 1

INSERT a file into a bytea datatype

Posted: 28.09.2007, 16:10
by mposthuma
Hi there

I wish to insert a JPG file into a bytea field.

When the file specified is plain TXT, everything works 100%.
However, if I try with JPG, it doesn't the record contains garbage.

Does anybody have an idea, or have sample code I can look at?

Thanks,
Michael

Posted: 06.10.2007, 16:58
by everdaniel
hi michael, how do you manage to insert that plain text file into the table? I try several times too to "insert" a file (any file) to a bytea field from delphi but I don't know how exactly? it is possible that you show me some example code?

thanks in advance

Posted: 19.11.2007, 06:28
by varathasiva
hi michael u can use this code like this
tngimZQCDItemPic.LoadFromFile(OpenPictureDialog1.FileName);
tngimZQ is a ZQuery and ItemPic is a field name