wcGetLO( )

Syntax . . Returns . . Rules . . Program Example . . Related Topics . . A-Z Index . . Home


Loads a large object (BLOB) such as an image, audio, or video file to the user defined buffer.

Example

returnCode = wcGetLO(cntrlHandle, pageID, lobuf, len);

Syntax

int wcGetLO(void *controlHandle, 
             char *pageID,
             void **lobuf,
             unsigned long *len)
controlHandle The handle to the control structure.
pageID The page ID.
lobuf The user defined buffer.
len The length of the object.

Returns

0 Success.
Error code Failure or exception. For a list of possible error codes, see Error Messages.

Rules

Program Example

The following code shows how wcGetLO( ) is used in an application. The following portion of the application calls wcGetLO( ) 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) /*the large object will be stored in lobuf*/
 		return ret; 

	/* .... use the buffer ....*/

	if (NULL != lobuf)
		free(lobuf);

	return (ERR_OK);
}

Related Topics

wcAppPageConnName( )
wcLoad( )
wcWriteLO( )


Top of Page . . Syntax . . Returns . . Rules . . Program Example . . A-Z Index . . Home