Anonymous - 2013-08-02

Hello there !, How can I write a image file from a Blob ? Im trying this without success

define SIZE_BUF 14449

FILE *f;
char temp2[SIZE_BUF];
unsigned int max_char[SIZE_BUF];
unsigned int max_byte[SIZE_BUF];

f = fopen("image.jpg","wb");

while(OCI_FetchNext(rs)){
lob1 = OCI_GetLob(rs,1);
OCI_LobSeek(lob1, 0, OCI_SEEK_SET);
OCI_LobRead2(lob1, temp2, NULL, max_byte);
ln = OCI_LobGetLength(lob1);
fwrite((const void*) &temp2,sizeof(temp2),1,f);
}

Please help