ColdFusion

Answers

Are session and application variables working?

Yes, they are. Make sure your Application.cfm file exists, its name starts with capital A (Unix is case sensitive), and the session is enabled, for example, with

BlockFactor option in CFQuery generates an error

The optional BlockFactor is not supported by the JDBC-ODBC bridge used to connect to MS Access databases.

Function ToString() on an XML variable does not work on the CFMX servers but works fine locally. What's wrong?

This is a confirmed Macromedia bug 48509 present on servers with sandbox security enabled. Here is a workaround you can use: instead of #ToString(myxmldoc)# use #HtmlCodeFormat(xmlOut)# More details are available in the Macromedia Forum.

How do I access LDAP/campus directory for user authentication?

Please, see the example below and also check the CFLDAP documentation. In the example below, if an exception is thrown then either the uid/login name or the password was incorrect or the server connection failed - inspect the exception message for more details. If the uid or password was incorrect the cfcatch. Message would include Inappropriate authentication. If the connection failed the cfcatch. Message would be Connection to LDAP Server failed. success
uid=#uid#
displayName=#results.displayName#
givenName=#results.givenName#
sn=#results.sn#
ou=#results.ou#
failed

How do I grant write permissions to the ColdFusion server for file uploads or XML file generation?

You can also use Unix ACLs to add extended permissions for the the cfmx user to your target folder (see ColdFusionMX: Unix ACLs FAQ for more information).

How do I obtain the clients' IP address?

The IP address of the client is the value of the CGI variable CGI.HTTP_X_FORWARDED_FOR for production websites, and CGI.REMOTE_ADDR for stage.web.uoguelph.ca or any virtual hostnames configured for your production website.

How do I schedule a job, e.g., a database report? Can I use CfSchedule?

If you need to run a specific job please design and test a CFMX script which executes the job, then contact the CCS Help Centre (preferably by email) and submit the following information:

  1. Which CFMX server should this task be set up - production or stage. Each task is to be tested on the stage first before moving to production.
  2. Top level directory for your website - if your website is “www.uoguelph.ca/myweb” then the top level directory is myweb
  3. Optional name of the task - the full task name will be "YourContextName.OptionalPart". This can be used in your future requests to refer to this specific task
  4. URL of the page which executes the job
  5. Request timeout - please, design your scheduled tasks efficiently, i.e., make them complete quickly. CCS reserves the right to suspend any task that may have a negative impact on the CFMX service
  6. StartDate, startTime, interval, endDate, endTime (see the cfschedule tag for details). The scheduled tasks should run outside of the peak hours, i.e., in early morning hours. If you do not require any specific time then give us an approximate window when you wish to run the job and we will coordinate it with other scheduled tasks
  7. Should the output be saved in a file? If yes then submit the file name and directory name (please, set the appropriate permissions for the cfmx server)
  8. Any other requested parameters - see the cfschedule tag for details
How should I set the server attribute in the CFPOP and CFMAIL tags?

Please, point your CFPOP tag to mail.uoguelph.ca. Regarding CFMAIL - we set the appropriate SMTP server in the ColdFusion administrator so the server attribute does not have to be specified in the CFMAIL tag - your application will use the default value set by the administrator.

Why does the CreateObject function or CFObject tag generate an error?

Applications are denied access to the CreateObject function and the CFObject tag due to security considerations. If you are using CFCs please instantiate them with the CFInvoke tag instead of the CFObject.