In this forum we will discuss things relating the ZEOSLib 6.6.x stable versions
Moderators: gto , EgonHugeist
scribes
Fresh Boarder
Posts: 8 Joined: 19.11.2005, 07:07
Post
by scribes » 12.05.2009, 15:48
Hi All,
I'm trying to upload a file to a field of type byte to PostGeSQL and I received the error below when I post a query
I'm using the code below
Stream := TMemoryStream.Create();
Stream.LoadFromFile(DAbre.FileName);
ZImagem.edit;
TBlobField(ZImagem.FieldByName('programa')).LoadFromStream(Stream);
ZImagem.post;
Stream.Free;
Thanks
Edmilson
You do not have the required permissions to view the files attached to this post.
trupka
Expert Boarder
Posts: 140 Joined: 26.08.2007, 22:10
Post
by trupka » 12.05.2009, 19:33
Code: Select all
(ZImagem.FieldByName('programa') as TBlobField).LoadFromFile(fileName)
Maybe this should do it?
scribes
Fresh Boarder
Posts: 8 Joined: 19.11.2005, 07:07
Post
by scribes » 12.05.2009, 22:26
Hi,
The same mistake not resolved
Thanks
Edmilson
seawolf
Zeos Dev Team *
Posts: 385 Joined: 04.06.2008, 19:50
Contact:
Post
by seawolf » 12.05.2009, 22:33
Which Delphi version are you using?
Does exists a column with the name displayed on the MessageDlg?
scribes
Fresh Boarder
Posts: 8 Joined: 19.11.2005, 07:07
Post
by scribes » 13.05.2009, 03:50
Hi,
I use Turbo Delphi
Not content that he is claiming and the contents of the file.
Thanks
Edmilson
trupka
Expert Boarder
Posts: 140 Joined: 26.08.2007, 22:10
Post
by trupka » 13.05.2009, 10:12
scribes ,
I'm having trouble to read text on attached picture, but it seems that error is more "database related".
Maybe you can use TZSQLMonitor or look into postgresql log file to reveal some more details about error?
scribes
Fresh Boarder
Posts: 8 Joined: 19.11.2005, 07:07
Post
by scribes » 15.05.2009, 07:07
Hi, trupka
Thanks for the idea I saw the error with TZSQLMonitor, I just generate the insert with the table name field and the error was here
app.name_app the right and so the field name_app
Thanks All
Edmilson