Skip to main content
August 9, 2009
Question

CFFILE not working right under schedule

  • August 9, 2009
  • 1 reply
  • 1257 views

Hi, I have a cfm page with just this content:

<cffile action="write" output="Authenticated User#chr(44)#IP Address#chr(44)#Date/Time#chr(44)#Browser#chr(44)#Page#chr(44)#Query#chr(44)#Referrer#chr(44)#Port" file="D:\ColdFusion8\logs\AITE_Test_System\#DateFormat(Now(), "mmm-dd-yyyy")#.csv">

When I run it manually, it works fine. However, when I use <cfschedule action="run" ...>, the file is created as it should, but the output isn't in the file (no CSV headers are present). Data is inserted thought via <cffile action="append" ...> on other pages though (not with cfschedule, just under normal user use)...

Any ideas why? Thanks.

My cfschedule I used to create the task:

<cfschedule action="update" task="CreateLog" startdate="8/8/09" starttime="12:00 AM" interval="daily" operation="httprequest" url="path_to_cfm_page" requesttimeout="60">

    This topic has been closed for replies.

    1 reply

    Inspiring
    August 11, 2009

    Keep in mind that CF scheduled tasks run under the CF server user account.  Make sure that the account on the server that the cf server is using has access to write in those directories.  That sounds like its probably what's going on.

    August 11, 2009

    It creates teh file in the directory fine, and the <cffile action="append"> works fine on all other pages. THe only thing that will not work is the output attribute in <cffile action="write" output=....>. I don't think the account is having and issues.

    Thanks.