FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Save binary file from BLOB field with TmySQL
Posts: 1067
Joined: Wed Nov 09, 2005 02:17 AM
Save binary file from BLOB field with TmySQL
Posted: Tue Jan 12, 2010 01:58 PM

I have a very large file. I need to split this file into several pieces and save in MySQL database.

I'm using fopen / fread to read these parts of the file, but can not save them in a blob field in my database.

As I read the parts of the file to be able to write into the blob?

Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil
Posts: 337
Joined: Fri Oct 07, 2005 02:44 PM
Re: Save binary file from BLOB field with TmySQL
Posted: Tue Jan 12, 2010 04:04 PM
Hello Vilian,

You can convert the parts in a mime64 format and save this in a varchar field like this
Code (fw): Select all Collapse
local nhfile
local ctemp

...
...

 do while fread(nhfile,@ctemp,5000) > 0
     xxobj:field := cmimeenc(ctemp)
     ....
     ....
enddo


where xxobj is the form with you open the mysql database.

For read only replace cmimeenc with cmimedec.

This working in harbour.

Best Regards,

Lautaro Moreira
Osorno
Chile

PD : Sorry for my bad english :-)
Hola,

Soy un Contador que por necesidad aprendio a programar y se quedo programando.
Posts: 1067
Joined: Wed Nov 09, 2005 02:17 AM
Re: Save binary file from BLOB field with TmySQL
Posted: Tue Jan 12, 2010 11:17 PM

Thanks Lautaro.

Sds,
Vilian F. Arraes
vilian@vfatec.com.br
Belém-Pa-Brazil

Continue the discussion