News by ColdFusion Cookbook

How do I parse RSS feeds?

21 Dec 01:33
RSS is a form of syndication in use by almost all blogs and many other types of web sites. It is a simple way to list, via XML, the latest content that has been updated on a web site. While parsing XML isn't difficult in ColdFusion, to work with RSS you have to have a good understanding of both the multiple "flavors" or RSS in use today as well a deep understanding of how the content is encoded within the XML. Luckily ColdFusion makes this relatively easy with the <CFFEED> tag. As a si...

How do I create RSS feeds?

21 Dec 01:33
The <cffeed> tag can be used to both read and create RSS feeds. To create an RSS feed, you need two things. First you need the data that will provide the content for RSS feed. Next you need a set of properties that define the RSS feed. Let's begin by getting the data for the feed. <cffeed> supports generating a feed from a query or structure. Most people will want to use a query, so let's begin with that: select ...

How do I parse RSS with ColdFusion?

19 Dec 23:14
RSS is a form of syndication in use by almost all blogs and many other types of web sites. It is a simple way to list, via XML, the latest content that has been updated on a web site. While parsing XML isn't difficult in ColdFusion, to work with RSS you have to have a good understanding of both the multiple "flavors" or RSS in use today as well a deep understanding of how the content is encoded within the XML. Luckily ColdFusion makes this relatively easy with the <CFFEED> tag. As a si...

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