News by ColdFusion Cookbook

This feed does not validate. (details)

How do I create a query by hand?

14 Aug 23:33
Most (but not all) ColdFusion queries come straight from the database, but there are times when you need to work with a query without using a database. Whether for debugging or other purposes, it is sometimes useful to be able to create a query manually. To create a query, you use the queryNew() function. This takes two arguments. The first argument is required and is a list of column names. The second argument is option and is a corresponding list of data types for the columns. If you use this ...

How can you test to see if two arrays are the same?

21 Jul 23:30
CF does not offer an easy way to compare two single dimension arrays. The most common solution involving looping through one array and comparing each item to the second array. It is a complicated and messy solution. Actually there's a very simple way of comparing two arrays using CF's underlying java. According to a recent blog by Rupesh Kumar of Adobe (http://coldfused.blogspot.com/), ColdFusion arrays are an implementation of java lists (java.util.List). So all the Java list methods are ava...

How do I find the file extension for a file?

21 Jul 23:24
Use the listLast() function.

How do I monitor a file directory for added/deleted/ changed files?

21 Jul 23:18
Event Gateways: Directory Watcher Open the ColdFusion Administrator and go to "EVENT GATEWAYS/Gateway Types". ColdFusion comes with a few predefined Gateway Types one of them being "DirectoryWatcher". Now select "Gateway Instances" under the "EVENT GATEWAYS" heading in the left-hand menu. Create a new directory somewhere on your server to host the CFC and Configuration files that will handle your new Gateway operation. For example: C:\Inetpub\wwwroot\com\company\services\dw 1. Inside...

How do I get information about a file?

18 Jul 22:40
Use the getFileInfo() function. GetFileInfo returns a structure with the following information: filename, path, parent directory, type, size, when the file was most recently modified, whether the file has read permission, write permission, and is hidden.

How can I retrieve attachments from an email message?

18 Jul 00:05
Use <cfpop> with the action attribute set to 'getall' and the attachmentpath attribute set to the directory on your server that you want to save any attachments. You can then loop over the resulting query object to perform any other required logic such as logging the attachment information ...
Pages   ← previous   next
1 2 3 4 5