Reply to topic
CFFILE Append; getting it to work??
palyne


Joined: 23 Oct 2006
Posts: 13
Reply with quote
Trying to make this work I eventually wrote two different lines of code. The two files referenced (one cfm, one txt) are in the same directory as the file with the code below. I can run it. It doesn't complain. Seems to work. But neither of the files are updated. What am I doing wrong? Would appreciate any guidance.

Code:

<cfset logthis1 = "#DateFormat(Now(),'YYYY-MM-DD')# #TimeFormat(Now(),'HH:MM')# | DELETE | Team X  deleted by Alias  (UID Z)">
<cffile action="Append" file="teamjic.cfm" output="#variables.logthis1#">

<cfset logthis2 = "#DateFormat(Now(),'YYYY-MM-DD')# #TimeFormat(Now(),'HH:MM')# | DELETE | Team X  deleted by Alias  (UID Z)">
<cffile action="Append" file="teamjic.txt" output="#variables.logthis2#">

I also tried adding:

addNewLine="yes" to the cffile tags but that didn't help.

[/code]
Jason101
Forum Regular

Joined: 14 Mar 2006
Posts: 550
Location: Harrisburg, PA
Reply with quote
You're not specifying the file correctly. You should have an absolute path in the file attribute. Try this:

Code:

<cffile action="Append" file="#ExpandPath('teamjic.cfm')#" output="#variables.logthis1#">
palyne


Joined: 23 Oct 2006
Posts: 13
Reply with quote
That worked! Gosh why do most solutions make me feel so stupid. (Don't answer that!) Thank you so much!!

PJ
Jason101
Forum Regular

Joined: 14 Mar 2006
Posts: 550
Location: Harrisburg, PA
Reply with quote
palyne wrote:
That worked! Gosh why do most solutions make me feel so stupid. (Don't answer that!) Thank you so much!!

PJ


Sometimes you just need another set of eyes. There's never a stupid question. Very Happy
CFFILE Append; getting it to work??
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT  
Page 1 of 1  

  
  
 Reply to topic