<cfsilent>
<cfparam
name="FORM.photo_url"
type="string"
default=""
/>
<cfset intStartTime = GetTickCount() />
<cfset FORM.photo_url = FORM.photo_url.Trim() />
<cfif Len( FORM.photo_url )>
<cfloop
index="strURL"
list="#FORM.photo_url#"
delimiters="#Chr( 13 )##Chr( 10 )#">
<cfthread
action="run"
name="photo_#GetFileFromPath( strURL )#">
<cfhttp
url="#strURL#"
method="GET"
getasbinary="yes"
path="#ExpandPath( './data/' )#"
file="#GetFileFromPath( strURL )#"
/>
</cfthread>
</cfloop>
</cfif>
</cfsilent>
<cfoutput>
<!DOCTYPE html PUBLIC "- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>ColdFusion 8 - CFThread Demo</title>
</head>
<body>
<h2>
Flickr.com Photo Download
</h2>
<cfif NOT Len( FORM.photo_url )>
<p>
Please enter photo URLs that you would like to
download. Each URL should be on a single line of
the following text area.
</p>
<form
action="#CGI.script_name#"
method="post">
<p>
<textarea
name="photo_url"
cols="70"
rows="20"
>#FORM.photo_url#</textarea>
</p>
<p>
<input type="submit" value="Download Now" />
</p>
</form>
<cfelse>
<p>
Your photos are being downloaded right now.
They should be done shortly.
</p>
</cfif>
<p>
Page ran in:
#NumberFormat(
((GetTickCount() - intStartTime) / 1000),
",.00"
)#
seconds.
</p>
</body>
</html>
</cfoutput>