2 Replies Latest reply on Aug 30, 2006 1:25 PM by dempster

    Alagad Captcha

    dempster Level 1
      I've been using Alagad Captcha on a number of pages to keep spam robots off guestbooks, forums and other features. I've been very pleased with it, but I'm having one problem.

      I have it set up to create the captcha image file and display it using CFCONTENT with deletefile="yes". When I test it, the image displays properly and the file is deleted. But every day I find dozens of captcha image files in the directory where they should be created and then deleted.

      These images are only created when I invoke the captcha component, and I only do that on pages where I also display and delete the image. So how are these images being created? Is it possible if a robot calls my page that the image gets created but since it is not displayed, it does not get deleted?

      Here's how I create and display the image:

      <cfset mycaptcha = createobject("component", "Captcha").configure(capdir)>
      <cfset captcharesults = mycaptcha.createcaptcha("",randword)>
      <img src="captchaImage.cfm?image=#capfile#">

      And here's the captchaImage.cfm code:

      <cfcontent type="image/jpeg" reset="No" file="#url.image#.jpg" deletefile="Yes">

        • 1. Re: Alagad Captcha
          <newbie /> Level 1

          What if the browser/robot is/was instructed to not download any images?

          Would your captchaimage.cfm template get called?

          Perhaps you need to add some temporary logging to the captchimage.cfm
          template? That way if you see that an image was not deleted, you can go to
          the log and see if the template was called and with what URL params.


          Good luck!
          • 2. Re: Alagad Captcha
            dempster Level 1
            I guess that it the problem. I set up a test of my own where I called the page using CFHTTP without displaying the image. Sure enough, the image file got created and not deleted. I guess I could see if the file is still defined at the end of the page and delete if so.

            Thanks.