Skip to content

UpdateLocalImage - cWebImage

Used to dynamically change a local file image

Type: Procedure

Parameters

Parameter Type Description
sPath String The full path and name on your server to the local (non web) image to be loaded

Syntax

Procedure UpdateLocalImage String sPath

Call Example

Send UpdateLocalImage sPath

Description

Local file images are images that are not directly accessible as a web image. You can set the psLocalFile property to reference a file in the server's local file system. If you wish to change this local image, you will use UpdateLocalImage.

So long as the web application has access rights to this file, then it can be read and sent to the image control on the client.

Object oImage is a cWebImage
    Send RegisterDownloadFolder of ghoWebResourceManager "C:\Photos\"
    Set psLocalFile to "C:\Photos\MiamiHoliday.jpg"
    //...
End_Object

In the above example, an image file (MiamiHoliday.jpg) in a local server folder is referenced using the psLocalFile property.

For security reasons, the psLocalFile property is not synchronized to the client. psLocalFile can be set in the object declaration, but not modified once the image control is loaded to the client. Send UpdateLocalImage to change the local file image that is displayed in the image control.

Object oButton is a cWebButton
    Set psCaption to "Change Holiday"
    Send RegisterDownloadFolder of ghoWebResourceManager "C:\Photos\"

    Procedure OnClick
        Send UpdateLocalImage of oImage to "C:\Photos\NewYorkHoliday.jpg"
    End_Procedure
End_Object

For security reasons, you must register the folder to be used as a download folder by calling RegisterDownloadFolder of ghoWebResourceManager.

If you wish to update a web-accessible file name, use psURL instead of psLocalFile and UpdateLocalImage.