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

CF9, IIS7.5, CFImage, /CFFileservlet/, Handler Mapping, URL Rewrite

New Here ,
Nov 09, 2010 Nov 09, 2010

I am trying to figure out how to enable the default handler in II7 like it was done in IIS6, with the "Verify file exisits" option turned off.

In IIS7 I have been lead to "Invoke handler only if request is mapped to:" however if that is unchecked, no static files (css, js, etc)  are served.

3.9K
Translate
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
Engaged ,
Nov 11, 2010 Nov 11, 2010

You don't want the handler unchecked because you are basically disabling it (as you found).  What you want to do is edit each ColdFusion handler mapping and invoke the handler only if the request is mapped to a file (on the Mapping tab).  It is also a good idea to specify only the GET and POST verbs for the handler (on the Verbs tab).  I think that will do what you are after.

Translate
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
New Here ,
Nov 12, 2010 Nov 12, 2010

Not sure you understand what is happening.

I have a server (WEB_DIRECTOR) using Application Request Routing with a reverse proxy.

That server is pointing to WEB_HOST_1

WEB_HOST_1 has the new IIS7 URL Rewrite module installed.

The url rewrite works fine. all cfm pages work fine.

However, when trying to use the CFFILESERVLET mapping within coldfusion, it doesnt find the file.

If I were to enable it to check for the file, just like in IIS6 where you UNCHECK verify file exists, this would seem to be counter productive.

Translate
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
Engaged ,
Nov 12, 2010 Nov 12, 2010

No I guess I don't understand.  If your ColdFusion pages are working then what is the issue?  What are you trying to do?  Which handler are you disabling the option on?  Your static files (style sheets, images, etc) should not stop being served when you disable the option on the ColdFusion handler.  ColdFusion does not need to process those.  What errors are you seeing in your logs?  I think some more info is needed to help you.

Translate
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
New Here ,
Nov 12, 2010 Nov 12, 2010

The following works as intended.

Fresh install of IIS7

     <cfimage action=captcha...>

The following breaks the CFFILESERVLET path


Fresh install of IIS7, install IIS URL REWRITE 2.0 module

without any rules set in the url rewrite section of IIS, the image still displays.

once ANY rule is set, the image no longer displays.

Translate
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
New Here ,
Nov 12, 2010 Nov 12, 2010

*sigh*

figured it out.

I had a rule with a regex of: ([0-9]{4,4}/{0,1} and it was picking up the numbers in the cfimage

/CFFileServlet/_cf_captcha/_captcha_img6546518182870894896.png

Fixed it by adding ^([0-9]{4,4}/{0,1}

Translate
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
Engaged ,
Nov 12, 2010 Nov 12, 2010

Are you sure that your tag meets all of the requirements?  Check out the documentation here: http://help.adobe.com/en_US/ColdFusion/9.0/CFMLRef/WSc3ff6d0ea77859461172e0811cbec22c24-7945.html

Specifically for captcha that article mentions:

For the CAPTCHA image to display, the width value must be greater than: fontSize times the number of characters specified in text times 1.08.

ColdFusion supports CAPTCHA images in PNG format only.

I believe the images generated from the cfimage tag are also served up from a differently location than your web-root.

Is your server allowing the PNG file extension?  With your URL rewrite rule are you still seeing the request reach IIS (iis log)?  Is it reaching ColdFusion (coldfusion log)?  Is your server allowing access to the directory where the generated image is stored (view the browser source code when it works to see where the image is actually stored)?

Translate
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
New Here ,
Nov 12, 2010 Nov 12, 2010

Fixed problem.

Translate
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
Engaged ,
Nov 12, 2010 Nov 12, 2010
LATEST

Cool!  Glad you found it.  I was just going to post another link for reference.  Ben had a similar problem and handled it a bit differently than your regex.  Maybe it will help.

http://www.bennadel.com/blog/1868-URL-Rewriting-And-ColdFusion-s-WriteToBrowser-Image-Functionality-...

Translate
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