Syntax . . Returns . . Rules . . Program Example . . Related Topics . . A-Z Index . . Home
Write a large object (BLOB) such as an image, audio, or video
file from the user defined buffer to the output buffer.
returnCode = wcWriteLO(cntrlHandle, lobuf, len);
int wcWriteLO(void *controlHandle, void *buf, unsigned long len)
controlHandle | The handle to the control structure. |
lobuf | The user-defined buffer holding a large object. |
len | The size of the buffer. |
0 | Success. |
Error code | Failure or exception. For a list of possible error codes, see Error Messages. |
The following code shows how wcWriteLO( ) is used in an application. The following portion of the application calls wcWriteLO( ) if the URL contains the variable MIvalObj.
int loadLargeObject(void *wcp, char *pageId) { char *contentType; char *lobuf; unsigned long len; wcGetVariable(wcp, "$MItypeObj", &contentType); wcSetVariable(wcp, "$Content_Type", contentType); wcLogPrintf(wcp, "Loading LO [%s] ...\n", pageId); if ((ret = wcGetLO(wcp, pageId, (void *)&lobuf, &len)) != 0) return; /* manipulate or modify the buffer .... */ /* write the large object from lobuf to output */ if ((ret = wcWriteLO(wcp, pageId, lobuf, len)) != 0) return; if (NULL != lobuf) free(lobuf); return (ERR_OK); }
Top of Page . . Syntax . . Returns . . Rules . . Program Example . . A-Z Index . . Home