Recent
Articles |
Using Spry:hover, Spry:even, & Spry:odd All Together One of the nicer features of Spry is the simple way you can apply even, odd, and hover classes to a dataset. This code will tell Spry to apply a CSS class named even for even rows, odd for odd rows, and to notice...
Yahoo Strategy Includes Attracting More Developers Yahoo's old founder and new boss, Jerry Yang, outlined where the company is heading now in a blog post yesterday. The three key items he sees after talking things through with people in the company are "Become the starting point for the most consumers."...
AJAX - Too Much Choice Last week I spoke with Todd Hay, VP of Marketing at ActiveGrid. "Too often, we fight ourselves in the AJAX community. For customers, there is too much confusion between AJAX libraries such as Dojo, JQuery...
Structure Versus Query Over the weekend and Monday, there was an interesting thread on CF-Talk. You can read the complete thread here. The basic problem involved getting a particular piece of data to show up in the final feed xml, in this case, the GUID attribute for an RSS 2.0 feed.
Three Lines Of Code To Boost Your Search Engine Traffic In the world of Web building, an opportunity to develop/code something quickly is a rare occasion. Mostly, you need to spend hours on research , planning and implementation (unless you code with CSS). Here's yet another thing you can do in a couple of minutes...
|
|
 |
|
10.31.07
DirectoryWatcher & ColdFusion Image Manipulation
By Raymond Camden
Now that ColdFusion 8 gives us a crap load of image functions as well as event gateways in all editions, I thought I'd write up a super quick demo on how you can use both in your application.
If you've never played with event gateways before, either because you thought they were too complex or you were running the Standard edition of ColdFusion, you should really take a look now. Event gateways are extremely powerful - but not as complex as you may think.
Before I begin - please check the docs on event gateways for a full explanation. I'm just writing a quick example here and won't be covering all the details.
The gateway I want to talk about today is the Directory Watcher. This gateway lets you, obviously, monitor a directory. You can have ColdFusion notice a change to the directory. This change can either be a new file, a modified file, or a deleted file.
So what are we going to do with our gateway? Our client, Hogwarts Press, Inc., has a group of reporters who handle press relations for the Hogwarts school. Being non-techies, they just want to take pictures. They can't be bothered to change these pictures for web publication.
To make things easier then we've set up a simple FTP connection for them to send their files to. They will download the pictures off their camera and FTP them up to a folder. (FTP is probably too much for them. You could also imagine an AIR application that lets them just drop files onto an icon.) The pictures will all be stored here:
/Users/ray/Documents/Web Sites/webroot/testingzone/dirwatcherimage/spool
Our code needs to:
• Check the file to ensure it is an image. (You never know with those non-techies.
• If an image, resize to a max width and height of 500 each. (Of course, you could also do other things like change the quality.)
• Move the image to a folder named 'ready.'
• If the file wasn't an image, delete it.
Continue reading this article.
About the Author: Raymond Camden, ray@camdenfamily.com
http://ray.camdenfamily.com
Raymond Camden is Vice President of Technology for roundpeg, Inc. A long
time ColdFusion user, Raymond has worked on numerous ColdFusion books
and is the creator of many of the most popular ColdFusion community web
sites. He is an Adobe Community Expert, user group manager, and the
proud father of three little bundles of joy.
|