F98MODAT Dowload File - JDE 9.2

Hi,
I trying create business function to dowload file (PDF) from F98MODAT, I can download file in the directory but I think decoding is not correct. Somebody knows?

jdeBufferUncompress((BYTE **)&pData, &nDataSize, (const BYTE *)dsF98MODAT.zutxft.lpValue, dsF98MODAT.zutxft.lSize);
jdeStrncpy(szFileName, (const JCHAR *)lpDS->szPathTo, DIM(szFileName) - 1);
stream = jdeFopen(szFileName, _J("w"));
jdeFwriteConvert(lpBhvrCom, (JCHAR *)dsF98MODAT.zutxft.lpValue, sizeof(JCHAR), dsF98MODAT.zutxft.lSize, stream);
jdeFclose(stream);
 

nkuebelbeck

VIP Member
Hi,
I trying create business function to dowload file (PDF) from F98MODAT, I can download file in the directory but I think decoding is not correct. Somebody knows?

jdeBufferUncompress((BYTE **)&pData, &nDataSize, (const BYTE *)dsF98MODAT.zutxft.lpValue, dsF98MODAT.zutxft.lSize);
jdeStrncpy(szFileName, (const JCHAR *)lpDS->szPathTo, DIM(szFileName) - 1);
stream = jdeFopen(szFileName, _J("w"));
jdeFwriteConvert(lpBhvrCom, (JCHAR *)dsF98MODAT.zutxft.lpValue, sizeof(JCHAR), dsF98MODAT.zutxft.lSize, stream);
jdeFclose(stream);

since pdf is already a compressed format i bet it's not compressed at all. Try just writing the BLOB field to a file in binary mode
 

BOster

Legendary Poster
Are you trying to extract media object content? There are a plethora of C API calls to work with media objects, you shouldn't have to read the table directly.
 
Discover how to build no-code data integrations and business process automations.
Top