• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Alagad Captcha

Contributor ,
Aug 29, 2006 Aug 29, 2006

Copy link to clipboard

Copied

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">

TOPICS
Advanced techniques

Views

339

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Deleted User
Aug 30, 2006 Aug 30, 2006

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!

Votes

Translate

Translate
Guest
Aug 30, 2006 Aug 30, 2006

Copy link to clipboard

Copied


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!

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Contributor ,
Aug 30, 2006 Aug 30, 2006

Copy link to clipboard

Copied

LATEST
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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation