[Gambas-devel] load and save to DB a binary file (not image either archive strings)

Tobias Boege tobias at ...692...
Sat Jul 13 07:47:27 CEST 2013


On Fri, 12 Jul 2013, PICCORO McKAY Lenz wrote:
> i have a binary file in fs, i wish toload and store in DB, (blob of course)
> and then recue from db and put again in same place..
> 
> i see in docu, but all file.save asumes string, so i try using base64
> coding a decoding but can work..
> 
> NOTE: when i post code in mail list, i got and error
> 

Please use the gambas-user mailing list for this kind of question. You are
currently posting to gambas-devel which should be used by people
*contributing* to Gambas and their kind of questions. You can find
information about the Gambas mailing lists here[0].

About your question:

You maybe come from C where strings are terminated by the ASCII NUL
character? This is not the case in Gambas. Gambas strings can contain as
many NULs and arbitrary other characters as you want as they explicitly
carry their size with them.

It's safe to use strings to store binary data as you can see in the
PictureDatabase example shipped with Gambas.

Regards,
Tobi

[0] http://gambasdoc.org/help/doc/forum?en&view





More information about the Devel mailing list