Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

CFFILE Action="Move"

Status
Not open for further replies.

calista

Programmer
Joined
Jan 24, 2001
Messages
545
Location
US
All I'm trying to do is move a file from one folder to another folder in the same directory. When I display the source and destination paths just prior to the CFFILE, the paths are correct. But, when the CFFILE executes, there is an extra "\" in front of the file name that isn't there the step before, so it errors out. Here is the code; what am I doing wrong? :-(

<!--- Get document information --->
<cfquery name=&quot;GetDocInfo&quot;
datasource=&quot;#Application.Datasource#&quot;>
SELECT *
FROM DocumentTable
WHERE DocID = '#URL.Document#'
</cfquery>

<cfoutput>
<font size=&quot;+2&quot; color=&quot;Red&quot;>
Source: #Application.DocLocation##GetDocInfo.DocFileName#
</font>
</cfoutput>
<br><br>
<cfoutput><font size=&quot;+2&quot; color=&quot;Blue&quot;>Destination: #Application.RootPath#Archive/#GetDocInfo.DocFileName#</font></cfoutput>

<!--- Move file to archive folder --->
<cffile action=&quot;MOVE&quot;
source=&quot;#Application.DocLocation##GetDocInfo.DocFileName#&quot;
destination=&quot;#Application.RootPath#Archive/#GetDocInfo.DocFileName#&quot;>
Calista :-X
Jedi Knight,
Champion of the Force
 
Just to give you some additional information, I tried just hard-coding the path and file name and got the same error:

Here is the revised code:
<!--- Move file to archive folder --->
<cffile action=&quot;MOVE&quot;
source=&quot; destination=&quot;
Here is the error:
Error Diagnostic Information
Error processing CFFILE

Unable to move file ' to path ' The filename, directory name, or volume label syntax is incorrect. (error 123)

The error occurred while processing an element with a general identifier of (CFFILE), occupying document position (33:1) to (35:76) in the template file C:\INETPUB\

Calista :-X
Jedi Knight,
Champion of the Force
 
Try this.

<cffile action=&quot;MOVE&quot; source=&quot;\cfdocs\NewIntranet\Documents\MyFile.pdf&quot; destination=&quot;\cfdocs\NewIntranet\Archive\MyFile.pdf&quot;>

If it doesnt work add the drive letter and folder(s) before the cfdocs folder
(ex. c:\inetpub\Just a guess.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top