Loads a large object (BLOB) such as an image, audio, or video file.
returnCode = wcLoadLO(cntrlHandle, pageID);
int wcLoadLO(void *controlHandle, char *pageID)
controlHandle | The handle to the control structure. |
pageID | The page ID. |
0 | Success. |
Error code | Failure or exception. For a list of possible error codes, see Error Messages. |
The following code shows how wcLoadLO( ) is used in an application. The following portion of the application calls wcLoadLO( ) if the URL contains the variable MIvalObj.
int handleRequest(wcp) void *wcp; { char *pagePtr; char *pageId; int ret; wcGetVariable(wcp, "MIvalObj", &pageId); if (pageId!=NULL) { if((ret = wcLoadLO(wcp, pageId)) < 0) return wcTraceErr(wcp, ret); } return (ret); }
The following user-defined tag, APB_IMG, places an image in an AppPage. It contains a setting for the variable LO. Therefore, the application calls wcLoadLo( ) whenever the user-defined tag APB_IMG is exploded.
<?MISQL SQL="select height, width, description, mime_type from webImages where ID='@ID@';"> <IMG BORDER=0 $(IF,$(!=,$1,0),HEIGHT=$1,) $(IF,$(!=,$2,0),WIDTH=$2,) ALT="$3" SRC="$WEB_HOME?MIvalObj=@ID@&filename=@ID@&MItypeObj=$4"> <?/MISQL>
This user-defined tag makes extensive use of variable functions, which are explained in Using Variables and Functions in AppPages.
The following is example HTML generated when this tag is exploded:
<IMG BORDER=0 HEIGHT=40 WIDTH=335 ALT="APB Logo" SRC="$WEB_HOME?MIvalObj=apb_logo&filename=apb_logo&MItypeObj=image/gif">
wcAppPageConnName( )
wcLoad( )