KNOWLEDGE BASE
Log In    |    Knowledge Base    |    4D Home
Tech Tip: Serving pictures with 4DACTION and 4DCGI
PRODUCT: 4D | VERSION: 2004 | PLATFORM: Mac & Win
Published On: August 18, 2006

In traditional HTML, image files are referred by the src attribute of an img tag, as shown the following example:

<img src="example_picture.png">

4D supports serving pictures through 4DACTION and 4DCGI. You can refer to the tech tip #13062 (Using the CREATE THUMBNAIL Command) for an example that uses 4DACTION. The syntax for 4DCGI is similar to that of 4DACTION:

<img src="/4dcgi/retreivePicture/myPicture">

where 4D will run On Web Connection method with "/4dcgi/retreivePicture" as a $1 parameter. The developers method should parse $1 and get the appropriate image from variable, record, resource, or blob. Afterwards, the image found should be sent back with the SEND HTML BLOB command.