Can I serve files from Iguana?

Introduction

When using “From HTTP” components in channels it is possible to serve files from the web service port. This is useful when returning page data that contains embedded resources, such as images or javascript files, to a web browser.

Issue [top]

How serve files from Iguana.

Solution [top]

Here is a simple “From HTTP” script that returns HTML data with an embedded image:

function main(Data) 
   local TestHtml = [[
      <html>
         <head><title>Test Html</title></head>
         <body> <img src="https://<some_path>/interfaceware.gif"> </body>
     </html>]] 
  net.http.respond{body=TestHtml} 
end

The root directory to serve files from can be configured in Settings>HTTP(S) Channels:

In this case, the returned HTML data will request an image named “interfaceware.gif”, and Iguana will look for the file in the /Applications/iNTERFACEWARE-Iguana/ directory.

Leave A Comment?