<!--- Get the actor information from the database --->
<CFQUERY NAME="Actor" DATASOURCE="OWS">
SELECT NameLast,NameFirst,ActorId from Actors
 where ActorID=#Val(Form.ActorId)#
</CFQUERY>

<HTML>
<TITLE>OWS Actor Photo Upload Results</TITLE>
<BODY>
<!--- Process the file upload --->
<CFFILE 
DESTINATION="C:\INETPUB\WWWROOT\OWS\CHAP35\FILES\"
ACTION="UPLOAD" 
NAMECONFLICT="OVERWRITE" 
FILEFIELD="PhotoFile" 
ACCEPT="image/gif,image/jpeg,image/pjpeg">

<CFOUTPUT>
Actor Photo Upload was Successful! 
Information about the file is detailed below.
<HR>
<TABLE BORDER WIDTH="100%">
<CAPTION><B>Photo Information</B></CAPTION>
<TR>
<TH VALIGN="TOP" ALIGN="LEFT">Actor 
Id:</TH><TD>#NumberFormat(Actor.ActorId,'0000')#</TD>
<TH VALIGN="TOP" ALIGN="LEFT">Actor Name:</TH>
<TD>#Actor.NameLast#, #Actor.NameFirst#</TD>
</TR>
<TR>
<TH VALIGN="TOP" ALIGN="LEFT">Photo File Name:</TH>
<TD>#File.ServerDirectory#\#FILE.ServerFile#</TD>
<TH VALIGN="TOP" ALIGN="LEFT">Content Type:</TH><TD>#File.ContentType#</TD>
</TR>
<TR>
<TH VALIGN="TOP" ALIGN="LEFT">Content SubType:</TH> 
<TD>#File.ContentSubType#</TD>
<TH VALIGN="TOP" ALIGN="LEFT">Client Path:</TH> 
<TD>#File.ClientDirectory#</TD>
</TR>
</CFOUTPUT>
<!--- rename the file to point to the actor based on actor id --->
<CFSET NewFile="ACTOR_#ACTOR.ACTORID#.#File.ServerFileExt#">
<CFFILE ACTION="RENAME" SOURCE="#File.ServerDirectory#\#FILE.ServerFile#" DESTINATION="#File.ServerDirectory#\#NewFile#">
<TR>
<TD COLSPAN="4" ALIGN="CENTER"><CFOUTPUT><IMG SRC="FILES/#NewFile#"></CFOUTPUT></TD>
</TR>
</TABLE>
</BODY>
</HTML>
