Tuesday, April 05, 2005

Coldfusion Really Unique

Quesiton: I am trying to write a file to a folder that may already contain a file of the same name. I know that if I use the NameConflict attibute and set it to MakeUnique, it works with CFFILE Action=Upload. However, NameConflict does not seem to work with CFFILE Action=Write. Is this correct? If so, is there a way to make it give the file a unique name?

Answer: CFFILE ACTION="WRITE" FILE=" #myvar#_#date#.html" OUTPUT="#stuff#" ATTRIBUTES="READONLY" NAMECONFLICT="MAKEUNIQUE"

Try #myvar#_#date#_#time#.html which will guarantee a unique name

0 Comments:

Post a Comment

<< Home