Skip to main content
Participant
April 5, 2018
Answered

cfschedule location and file type

  • April 5, 2018
  • 1 reply
  • 641 views

good morning,

i've been using CF for about 1.5 years. I'M using Coldfusion 2016 in a windows PC. I'm trying to figure out the location to save a <cfschedule> document.

1 Should the file be saved as a regular .cfm file or do I save it as a template  ".dwt.cfm" file and put it into the template folder of my file directory?

The reason is that I am not getting any thing to fire-off

2. My second question is: can  multiple <cfschedule> code be placed inside of the same coldfusion file?

Below is my code that I used to point to the file to execute...

<!-- TemplateBeginEditable name="head" -->

<!--- This read-only example schedules a task.

To run the example, remove the comments around the code

and change the startDate, startTime, url, file, and path attributes

to appropriate values. --->

<cfschedule action = "update"

task = "ove3r0"

operation = "HTTPRequest"

url = "www.studentlt.com\scheduled_tasks\over30.cfm"

startDate = "3/31/18"

startTime = "6:00 AM"

interval = "86401"

resolveURL = "yes"

publish = "Yes"

file = "sample.html"

path = "D:\home\studentlt.com\wwwroot\SR\scheduled_tasks\"

requestTimeOut = "600"> <!-- TemplateEndEditable -->

    This topic has been closed for replies.
    Correct answer Dave Watts

    There isn't a "right" location to save a file created by CFSCHEDULE. The right location for you will depend on what you want to do with the file, and what's in it. Likewise, there's no correct extension really, but most CFSCHEDULE calls will simply generate HTML output so you'd probably use .html unless you explicitly want the output to be run through CF for some reason.

    You can have as many CFSCHEDULE tags as you want within a file.

    Dave Watts, Fig Leaf Software

    1 reply

    Dave WattsCommunity ExpertCorrect answer
    Community Expert
    April 5, 2018

    There isn't a "right" location to save a file created by CFSCHEDULE. The right location for you will depend on what you want to do with the file, and what's in it. Likewise, there's no correct extension really, but most CFSCHEDULE calls will simply generate HTML output so you'd probably use .html unless you explicitly want the output to be run through CF for some reason.

    You can have as many CFSCHEDULE tags as you want within a file.

    Dave Watts, Fig Leaf Software

    Dave Watts, Eidolon LLC
    Participant
    April 5, 2018

    Dave,

    Thank you for clearing up my 2nd question. For my 1st question, I guess what I'm asking is does the file extension that the cfschedule itself is written in, need to be saved as a ".CFM" file or a ".dwt.cfm"  and does it matter where that same cfschedule file stored?

    WolfShade
    Legend
    April 5, 2018

    .dwt is, unless I'm missing something, a Dreamweaver template.  .dwt files have nothing to do with ColdFusion.

    You _can_ name the file with .dwt.cfm, or you can name it with just .cfm or even .cfml.  The important thing to remember is that if the file does not end with .cfm, .cfml, or .cfc (for components), ColdFusion server will not be involved with it.

    HTH,

    ^ _ ^