[Lazarus] Inserting images in mysql records [resolved]
hugues.moisy at gmail.com
Fri May 4 14:49:32 CEST 2012
Thank you for your answer.
No my field is declared as BLOB and not text. But after searching on web,
I found that BLOB type in 64KB. I have to use MEDIUMBLOB and LONGBLOB
Hope it'll be useful for anybody else.
Le Fri, 04 May 2012 15:15:47 +0530, <michael.vancanneyt at wisa.be> a écrit:
> On Fri, 4 May 2012, Hugues Moisy wrote:
>> Hi all,
>> I'm trying to insert gif file content into a blob field in a mysql
>> database. Insertion process works, but the size of the data inserted is
>> cut to 64 Kbytes, so the images are cut and impossible to read (crash),
>> except those that are less than 64KB.
>> my function is this :
>> conn := getConnection(_TypeConnection);
>> query.DataBase := conn;
>> query.SQL.Add('update volumepage set page_image = :image,
>> image_filename = :imgname where volume_id = :vol and page_index =
>> could somebody explain me the origin of the problem : is it a problem
>> in the database, or in the LoadFromFile ?
> It depends on the type of field you created in the database. If it is a
> 'Text' field, then I think Mysql limits the content to 64k bytes.
> sqldb by itself does not impose limits, as far as I know.
> Lazarus mailing list
> Lazarus at lists.lazarus.freepascal.org
Utilisant le logiciel de courrier révolutionnaire d'Opera :
More information about the Lazarus