I do not know solution to your problem, but is it possible for u to use
BASE64 coding to convert binary file into text file and save it as test
field?


Brona

> -----Original Message-----
> From: John Scott [mailto:[EMAIL PROTECTED]
> Sent: Friday, January 02, 2004 2:35 PM
> To: [EMAIL PROTECTED]
> Subject: [sqlite] sqlite_encode_binary problems
>
>
> Hi folks,
>
> I want to use sqlite_encode_binary to encode zip files into
> sqlite databse. But somehow I don't get the wanted result of this
> procedure.
> Can someone tell me where i made a mistake??
>
>
> Encoding:
>
> wxFFile *load_file = new wxFFile();
> load_file->Open("pc.zip", "rb");
> size_t size = load_file->Length();
>
>  char in[size];
> unsigned long nLoadSize = load_file->Read((void *)in, size);
> unsigned char out[2 +(257*nLoadSize)/254];
> sqlite_encode_binary((const unsigned char*)in,
> 257*nLoadSize)/254, (unsigned char*)out);
>
> Decoding:
>
> query_result->Execute("select * from file where ID = '1');
> const char* binary = query_result->GetField(0, 2);
> const char* out;
> int nSize = strlen(binary);
> unsigned char out[nSize];
> sqlite_decode_binary((const unsigned char*)binary, (unsigned char*)out);
>
> Result:
>
> The zip file is broken.
>
>
> Please help me,
> best regardes
> Martin
>
>
>
>
> ---------------------------------
> 每天都 Yahoo!奇摩
> 海的顏色、風的氣息、愛你的溫度,盡在信紙底圖
> 信紙底圖

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to