The first thing we need to do is to define the save file path and the web path to the "myimages" folder which we will later query for the files.
<cfset imagepath =
"C:\webroot\myimages">
<cfset imageURL = "http://myserver/myimages">
<!--- first get a list of all jpg's in your image
directory --->
<cfdirectory action="LIST"
directory="#imagepath#"
filter="*.jpg" name="homeimages">
<!--- This variable will hold a comma delimited list of
all the jpg's found in the directory --->
<cfparam name="imglist"
default="">
<cfloop query="homeimages">
<cfset imglist = listappend(imglist, name,
",")>
</cfloop>
<!--- "ThisImage" is this rounds random image file --->
<cfset thisimage = listgetat(imglist, randrange(1,
listlen(imglist)))>
<cfoutput>
<img src="#imageURL#/#ThisImage#">
</cfoutput>
<!--- hope someone can use it and as always... Have
fun! --->