When you update the database with the filename as I have written, it will end up putting the entire path that the user originaly had precedding the file that was submitted. To fix this, I use javascript to parse the File name out of the path.
Let me know if you have any questions or if anything needs more explanation
Main Topics
Browse All Topics





by: RobotManPosted on 2000-05-24 at 13:00:17ID: 2842466
You need something like the following:
ta"> #FirstName # #LastName#</option>
wroot\CFDO CS\Picture s" ACTION="upload" NAMECONFLICT="makeunique" FILEFIELD="File">
(Simplified Page 1)
<html>
<head>
<title>CFFILE DEMO </title>
</head>
<body>
<!--- Get a list of employees from the database. --->
<!-- These are the registered users for this program -->
<CFQUERY NAME="GetNames" DATASOURCE="test">
SELECT IDNum, FirstName, LastName
FROM amp_reg
ORDER BY LastName, FirstName
</CFQUERY>
<CFFORM action="addpicture.cfm" method="post" name="Archive" enctype="multipart/form-da
<CFOUTPUT QUERY="GetNames">
<CFSET IDNum = #IDNum#>
<option value="#variables.IDNum#">
</CFOUTPUT>
<input type="file" name="path" size="29">
<input type="submit" value="Upload a file">
</CFORM>
(Simplified Page 2)
<html>
<head>
<title>CFFILE DEMO - Upload</title>
</head>
<body>
<CFINSERT DATASOURCE="test" TABLENAME="amp_reg" FORMFIELDS="LastName, FirstName, File">
<CFFILE DESTINATION="C:\Inetpub\ww
</body>