Skip to main content
Ben Nadel
On User Experience (UX) Design, JavaScript, ColdFusion, Node.js, Life, and Love.

Sean Smith

Member since Jan 22, 2010

Recent Blog Comments By Sean Smith

  • Using CAPTCHA In ColdFusion 8

    Posted on Nov 8, 2010 at 5:51 PM

    @Frank, Haven't tested this. Probably needs some tweaking, but this should get you going. Assumes there is a input tag for the captcha with an id attribute of "captcha" (no quotes). Grab these javascript cookie functions. Put in head tag: http://w3schools.com/JS/js_cookies.asp add atr... read more »

  • ColdFusion Path Usage And Manipulation Overview

    Posted on Jun 24, 2010 at 3:54 PM

    @JP, Assumptions: The datasource is to an MS Access database (otherwise, there is no physical file to reference...OK, maybe an ISAM or something like that, but anyway) Windows platform Dedicated server (otherwise you're screwed. You won't have access to the API to get the info you want. If a share... read more »

  • ColdFusion Path Usage And Manipulation Overview

    Posted on Apr 29, 2010 at 12:23 AM

    @Remus, <cfquery name="saveimagefilepath" datasource="something"> INSERT INTO TABLENAME (ImageFilePath) VALUES (#imagefilepath#) </cfquery> where: something - connection to you db configured in the CF admin TABLENAME - existing table in db with a column "ImageFilePath" #imagefilepath# ... read more »

  • ColdFusion Path Usage And Manipulation Overview

    Posted on Apr 28, 2010 at 5:25 PM

    @et al, The code that creates the thumbnails was coded a certain way for a specific reason. I was finding problems otherwise (image not sizing proportionally). The key is to load the image into a variable and create a new file and then do the resize on the copy, rather than chaining commands by usi... read more »

  • ColdFusion Path Usage And Manipulation Overview

    Posted on Apr 28, 2010 at 5:01 PM

    @Remus, Here is my standard image upload function: <!--- --------------------------------------------- ---> <!--- uploadImage ---> <!--- --------------------------------------------- ---> <!--- Returns physical image filname to store in db (... read more »

  • ColdFusion Path Usage And Manipulation Overview

    Posted on Apr 3, 2010 at 2:13 PM

    @Chris, Not sure what you mean by Javascript code-behind? There is no javascript on the server. Anyway, you're having to hard code the include path in page.cfm, no? Then in that file you can set a variable that is used for both cf and js includes: <cfset announPath = "/helpers/content"> <... read more »

  • ColdFusion Path Usage And Manipulation Overview

    Posted on Mar 22, 2010 at 7:50 PM

    @Ben, I'm sure it was planetary alignment. I'll bet if I go back and put the old code in, it will work now.... read more »

  • ColdFusion Path Usage And Manipulation Overview

    Posted on Mar 19, 2010 at 3:35 PM

    @Ben, Sorry. Clarification. expandpath worked for me in application.cfc, but not in other templates.... read more »

  • ColdFusion Path Usage And Manipulation Overview

    Posted on Mar 19, 2010 at 3:33 PM

    @Ben, Never did. Worked around it and moved on. Here is what I ended up with in onApplicationStart: // chop off "\application.cfc" application.appdir = GetCurrentTemplatePath().ReplaceFirst( "[\\\/][^\\\/]*$", "" ); // strip off the webroot, what is left is the path off webroot to the app appli... read more »

  • Converting To GMT And From GMT In ColdFusion For Use With HTTP Time Stamps

    Posted on Feb 25, 2010 at 8:09 PM

    @Casey, Since SQL 2005 there is GETUTCDATE() or, if you need total precision SYSUTCDATETIME(). These guys handle the offset calc for you. When getting date/time data back out to the server's local time, use SYSDATETIMEOFFSET() http://msdn.microsoft.com/en-us/library/ms178635.aspx @Et al, Ho... read more »

  • Using CAPTCHA In ColdFusion 8

    Posted on Feb 24, 2010 at 7:21 PM

    Some cross pollinating on this topic: If stuffing the hash on the form, be sure to add some salt before creating the hash, then salt the user's response before comparing the hashes: http://www.coldfusionjedi.com/index.cfm/2008/2/28/Quick-and-dirty-CAPTCHA-Guide--for-ColdFusion-8 For the blind, s... read more »

  • ColdFusion Path Usage And Manipulation Overview

    Posted on Feb 24, 2010 at 12:38 AM

    @Ben, Nope. Fresh CF install, no mappings. Strangest thing I've seen in 5+ years using CF. To lazy to reinstall to see if that fixed it. @Brian, Unfortunately, no central db. If you care, more background below. Sean The app manages multiple instances. Each instance has it's own db, or multip... read more »

  • ColdFusion Path Usage And Manipulation Overview

    Posted on Feb 23, 2010 at 2:35 AM

    Anyone ever see this: expandpath("/") returns: E:\ColdFusion9\wwwroot\ instead of D:\inetpub\wwwroot (your drive letters will vary) I have an application that was working well (front controller, etc., etc.) until an OS hard drive crashed on me, one of a two disk RAID 0 array. @#$%#@! cheap SSD... read more »

  • Creating Globally Accessible User Defined Functions In ColdFusion (Safer Version)

    Posted on Feb 1, 2010 at 7:12 PM

    The code skips the registration of any application scope methods (methods defined in application.cfc) that are the CF application control methods: onApplicationStart() onRequestStart() onSessionStart() onError() onApplicationEnd() I just did that to cut down clutter. It's doubtful any page would w... read more »

  • Creating Globally Accessible User Defined Functions In ColdFusion (Safer Version)

    Posted on Jan 30, 2010 at 4:24 PM

    Sean Corfield over at Mere Mortals offered a cleaner method for the code: http://stannard.net .au/blog/index.cfm/2008/5/9/Using-Constants-in-ColdFusion-Components#c7E7025A1-3048-2D64-FCB1288CFBE390B4 application.globalmethods = structnew(); for (key in this) { if (iscustomfunction(this[key])... read more »

  • Creating Globally Accessible User Defined Functions In ColdFusion (Safer Version)

    Posted on Jan 26, 2010 at 8:16 PM

    @Ben, All right. Your idea worked splendidly! Now the API of the cfc is not changed using this scheme. Also, I stopped the loop-on-structkeys silliness and just used structappend. Here is the whole package: [Put in application.cfc:] <cffunction name="onApplicationStart"> . . . snip . . ... read more »

  • Creating Globally Accessible User Defined Functions In ColdFusion (Safer Version)

    Posted on Jan 22, 2010 at 7:52 PM

    @Ben Nadel, It's really just a (manual, late/runtime) pseudo-inheritance of a base class! Har har har.... It is a bummer that those functions become public functions of the component. Can't think of any way to make them private. Very strange thing happened as I was tinkering: I changed registe... read more »

  • Creating Globally Accessible User Defined Functions In ColdFusion (Safer Version)

    Posted on Jan 22, 2010 at 1:11 PM

    So, how about having any page/component/udf declare that it intends to use global udfs go get the global udfs into the unnamed scope? Here is some code that I use for what Ken talked about ("Just set up your utility methods/functions in an application-scoped singleton...") 1) In application.cfc cf... read more »