Ok - what am I doing wrong? I am building an intranet and want users to be able to upload graphics. Everything works fine and the file is uploaded with the correct name to the correct folder. However, the file name (CFFILE.SERVERFILE)is being changed (e.g., C:\WINNT\TEMP\ACF165.tmp) when I try to write it to my database field (photo).
I know I need to make a connection between cffile.serverfile and PHOTO. I'm stumped as to how. Nothing seems to work.
Thanks!
<cfinclude template="../../Connections/Excess.cfm">
<cfparam name="ID" default="1">
<cfparam name="Recordset1__varID" default="#ID#">
<cfquery name="Recordset1" datasource=#MM_Excess_DSN# username=#MM_Excess_USERNAME# password=#MM_Excess_PASSWORD#>
SELECT ID FROM tb_main WHERE ID LIKE '#Recordset1__varID#'
</cfquery>
<html>
<head>
<title>Insite</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="../../in2.css" type="text/css">
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#000099" vlink="#000099" alink="#000099">
<CFFILE action="upload"
filefield="photo"
nameconflict="overwrite"
destination="C:\Inetpub\
<CFUPDATE DATASOURCE="#MM_Excess_DSN#"
TABLENAME="tb_main"
FORMFIELDS="photo">
<div id="Layer1" style="position:absolute; left:37px; top:21px; width:477px; height:257px; z-index:1">You
have uploaded
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>ID</td>
<td><cfoutput>#Recordset1.ID#</cfoutput></td>
</tr>
<tr>
<td>Attempted Server File</td>
<td><cfoutput>#cffile.AttemptedServerFile#</cfoutput></td>
</tr>
<tr>
<td>Client Directory</td>
<td><cfoutput>#cffile.ClientDirectory#</cfoutput></td>
</tr>
<tr>
<td>Client File Name</td>
<td><cfoutput>#cffile.ClientFileName#</cfoutput></td>
</tr>
<tr>
<td>Client File Extension</td>
<td><cfoutput>#cffile.ClientFileExt#</cfoutput></td>
</tr>
<tr>
<td>Content Sub Type</td>
<td><cfoutput>#cffile.ContentSubType#</cfoutput></td>
</tr>
<tr>
<td>Date Last Accessed</td>
<td><cfoutput>#cffile.DateLastAccessed#</cfoutput></td>
</tr>
<tr>
<td>File Existed</td>
<td><cfoutput>#cffile.FileExisted#</cfoutput></td>
</tr>
<tr>
<td>File Size</td>
<td><cfoutput>#cffile.FileSize#</cfoutput></td>
</tr>
<tr>
<td>File Was Appended</td>
<td><cfoutput>#cffile.FileWasAppended#</cfoutput></td>
</tr>
<tr>
<td>File Was Overwritten</td>
<td><cfoutput>#cffile.FileWasOverwritten#</cfoutput></td>
</tr>
<tr>
<td>File Was Renamed</td>
<td><cfoutput>#cffile.FileWasRenamed#</cfoutput></td>
</tr>
<tr>
<td>File Was Saved</td>
<td><cfoutput>#cffile.FileWasSaved#</cfoutput></td>
</tr>
<tr>
<td>Old File Size</td>
<td><cfoutput>#cffile.OldFileSize#</cfoutput></td>
</tr>
<tr>
<td>Server Directory</td>
<td><cfoutput>#cffile.ServerDirectory#</cfoutput></td>
</tr>
<tr>
<td>Server File</td>
<td><cfoutput>#cffile.ServerFile#</cfoutput></td>
</tr>
<tr>
<td>Server File Ext</td>
<td><cfoutput>#cffile.ServerFileExt#</cfoutput></td>
</tr>
<tr>
<td>Time Created</td>
<td><cfoutput>#cffile.TimeCreated#</cfoutput></td>
</tr>
<tr>
<td>Time Last Modified</td>
<td><cfoutput>#cffile.TimeLastModified#</cfoutput></td>
</tr>
</table>
</div>
</body>
</html> Peace
BT
I know I need to make a connection between cffile.serverfile and PHOTO. I'm stumped as to how. Nothing seems to work.
Thanks!
<cfinclude template="../../Connections/Excess.cfm">
<cfparam name="ID" default="1">
<cfparam name="Recordset1__varID" default="#ID#">
<cfquery name="Recordset1" datasource=#MM_Excess_DSN# username=#MM_Excess_USERNAME# password=#MM_Excess_PASSWORD#>
SELECT ID FROM tb_main WHERE ID LIKE '#Recordset1__varID#'
</cfquery>
<html>
<head>
<title>Insite</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="../../in2.css" type="text/css">
</head>
<body bgcolor="#FFFFFF" text="#000000" link="#000099" vlink="#000099" alink="#000099">
<CFFILE action="upload"
filefield="photo"
nameconflict="overwrite"
destination="C:\Inetpub\
<CFUPDATE DATASOURCE="#MM_Excess_DSN#"
TABLENAME="tb_main"
FORMFIELDS="photo">
<div id="Layer1" style="position:absolute; left:37px; top:21px; width:477px; height:257px; z-index:1">You
have uploaded
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>ID</td>
<td><cfoutput>#Recordset1.ID#</cfoutput></td>
</tr>
<tr>
<td>Attempted Server File</td>
<td><cfoutput>#cffile.AttemptedServerFile#</cfoutput></td>
</tr>
<tr>
<td>Client Directory</td>
<td><cfoutput>#cffile.ClientDirectory#</cfoutput></td>
</tr>
<tr>
<td>Client File Name</td>
<td><cfoutput>#cffile.ClientFileName#</cfoutput></td>
</tr>
<tr>
<td>Client File Extension</td>
<td><cfoutput>#cffile.ClientFileExt#</cfoutput></td>
</tr>
<tr>
<td>Content Sub Type</td>
<td><cfoutput>#cffile.ContentSubType#</cfoutput></td>
</tr>
<tr>
<td>Date Last Accessed</td>
<td><cfoutput>#cffile.DateLastAccessed#</cfoutput></td>
</tr>
<tr>
<td>File Existed</td>
<td><cfoutput>#cffile.FileExisted#</cfoutput></td>
</tr>
<tr>
<td>File Size</td>
<td><cfoutput>#cffile.FileSize#</cfoutput></td>
</tr>
<tr>
<td>File Was Appended</td>
<td><cfoutput>#cffile.FileWasAppended#</cfoutput></td>
</tr>
<tr>
<td>File Was Overwritten</td>
<td><cfoutput>#cffile.FileWasOverwritten#</cfoutput></td>
</tr>
<tr>
<td>File Was Renamed</td>
<td><cfoutput>#cffile.FileWasRenamed#</cfoutput></td>
</tr>
<tr>
<td>File Was Saved</td>
<td><cfoutput>#cffile.FileWasSaved#</cfoutput></td>
</tr>
<tr>
<td>Old File Size</td>
<td><cfoutput>#cffile.OldFileSize#</cfoutput></td>
</tr>
<tr>
<td>Server Directory</td>
<td><cfoutput>#cffile.ServerDirectory#</cfoutput></td>
</tr>
<tr>
<td>Server File</td>
<td><cfoutput>#cffile.ServerFile#</cfoutput></td>
</tr>
<tr>
<td>Server File Ext</td>
<td><cfoutput>#cffile.ServerFileExt#</cfoutput></td>
</tr>
<tr>
<td>Time Created</td>
<td><cfoutput>#cffile.TimeCreated#</cfoutput></td>
</tr>
<tr>
<td>Time Last Modified</td>
<td><cfoutput>#cffile.TimeLastModified#</cfoutput></td>
</tr>
</table>
</div>
</body>
</html> Peace
BT