npsStreamImage

If an image is to be displayed in a wizard page, the Tcl code of the wizard needs to make the image available to the GUI. However, for security reasons the Content Management Server normally has no access to the file system of the GUI and vice versa.

An alternative possibility to have a wizard display an image is to transfer the image to the Content Manager by the means of streaming. The GUI or the browser can then request the image from the Content Manager.

The wizard first places the image file on the server using this command:

set ticketId [stream uploadFile path]

Then it can write the following tag to the standard output so that the GUI can generate an appropriate img tag.

<npsStreamImage ticketId='$ticketId' mimeType='$mimeType' />

The GUI translates this tag to the following img element. The URL in its src tag causes the Content Manager to deliver the image:

<img src="/NPS/streampreview?ticketId=34253&mimeType=image%2Fgif" />

Both tag attributes, ticketId and mimeType are obligatory.