Okay, the copy operation threw a slightly different error message, which
pointed me at the root cause - the destination folder did not exist.  The
copy or move operation does not create the directory if it does not exist.
Therefore, I had to use cfdirectory first, and then the move operation works
fine.


Thanks for the help.
-- Jeff

-----Original Message-----
From: Mike Townend [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 13, 2004 7:43 AM
To: CF-Talk
Subject: RE: CFFile Move Error

It could be that there is a file lock involved which will result in the move
failing (as its a copy then delete).  Change the code to do a copy instead
of a move to see if it initially fixes the current problem you are having.

If it does then I would suggest that you do this instead but setup a
schedule that cleans out the directory every now and then (based on
timestamps so that it doesnt play with a file thats being used) so that the
directory doesnt get bloated and fill up the server.

HTH

-----Original Message-----
From: Jeff Chastain [mailto:[EMAIL PROTECTED]
Sent: Tuesday, January 13, 2004 13:34
To: CF-Talk
Subject: RE: CFFile Move Error

Anybody?  This is driving me crazy.

-----Original Message-----
From: Jeff Chastain [mailto:[EMAIL PROTECTED]
Sent: Monday, January 12, 2004 9:43 AM
To: CF-Talk
Subject: CFFile Move Error

I am working with a script that interacts with a mail server, reading
messages from a specific POP account and processing them.  The problem I am
running into is dealing with the message attachments.  In the <CFMAIL tag, I
store all attachments in a central folder with unique file names.  Then
during the processing, I am attempting to move them to different folders and
rename them back to their original file names.

I am getting the following error though on the <CFFILE tag while attempting
to move and rename the files:

'Attribute validation error for tag CFFILE.  The value of the attribute
source which is currently "D:\attachments\fd4.dtd", is invalid.'

However, if I copy this file path and paste it into the run window on the
server (start -> run), the server returns the file - i.e. the path is valid.
What am I missing here?

------------------------------

<cfloop from="1" to="#listLen(archiveMessages.attachments, ' ')#"
index="attachmentIndex">
    <cfset currentAttachmentFile =
listGetAt(archiveMessages.attachmentFiles, attachmentIndex, ' ')> <!---
original, unmodified attachment file name only (no path info) --->
    <cfset origAttachmentFileName = listGetAt(archiveMessages.attachments,
attachmentIndex, ' ')> <!--- unique attachment file name including current
path location --->
    <cffile action="" source="#currentAttachmentFile#"
destination="#variables.baseFilePath#\#friendlyUID#\#origAttachmentFileName#
"> <!--- rename the attachment back to the original file name and move to
folder unique to parent message --->
</cfloop>

*** The list functions are parsing the attachment list using the TAB string
as deliminators - that is just not appearing in the HTML message.

------------------------------

Thanks,
-- Jeff

_________________________________________

Jeff Chastain
Web Applications Developer, Consultant
Certified Macromedia ColdFusion Developer

FBXSolutions
<http://www.fbxsolutions.com/> http://www.fbxsolutions.com
email:  <mailto:[EMAIL PROTECTED]>
[EMAIL PROTECTED]
phone: 469.964.2047
  _____
  _____
  _____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to