mod_xsendfile problems

Helicon Ape provides support for Apache .htacces and .htpasswd configuration files for Microsoft IIS.
User avatar
Posts: 1
Joined: 04 Feb 2013, 17:24

mod_xsendfile problems

05 Feb 2013, 15:04

Hi, I've been trying to get mod_xsendfile to run on IIS 7.5, Win 2008 R2 with Ape 3.1.0.95 and I can't seem to get it to function completely. I need to use it in ColdFusion 9, and have modified the IIS connector to use the "jrun_iis6_wildcard.dll" so I can use mod_rewrite. When I try to open my test page, I receive a 0 byte response that still contains the X-SendFile header in it. The logs show entries for my request with "OK", but nothing ever comes down.

test_xsendfile.cfm:
<cfsetting showdebugoutput="false" enablecfoutputonly="true" />
<cfprocessingdirective suppressWhitespace="true">
<cfheader name="Content-Disposition" value="filename=main.gif" />
<cfheader name="Content-Type" value="image/gif" />
<cfheader name="X-SendFile" value="C:\inetpub\wwwroot\main.gif" />
</cfprocessingdirective>

error.log:
[2/5/2013 12:11:38 PM] [1.2] (8) [/test_xsendfile.cfm] X-Sendfile: C:\inetpub\wwwroot\main.gif
[2/5/2013 12:11:38 PM] [1.2] (8) [/test_xsendfile.cfm] X-Sendfile: C:\inetpub\wwwroot\main.gif - OK


So after considering this had something to do with the connector, I decided to quickly write an ASP script to do the same test. In this situation I see the same information in the logs, and receive a 0 byte response, however the X-SendFile header has been removed.

test_xsendfile.asp
<%
Response.addHeader "Content-Disposition", "filename=main.gif"
Response.addHeader "Content-Type", "image/gif"
Response.addHeader "X-SendFile", "c:\inetpub\wwwroot\main.gif"
%>

error.log:
[2/5/2013 12:41:25 PM] [1.2] (8) [/test_xsendfile.asp] X-Sendfile: c:\inetpub\wwwroot\main.gif
[2/5/2013 12:41:25 PM] [1.2] (8) [/test_xsendfile.asp] X-Sendfile: c:\inetpub\wwwroot\main.gif - OK
[2/5/2013 12:41:25 PM] [1.2] (8) [/test_xsendfile.asp] X-Sendfile:

I've checked permissions on this file and those look fine. The file is in the webroot, and I am able to directly browse to it and view it without a problem. Am I missing something?

User avatar
Posts: 402
Joined: 06 Mar 2012, 11:59

Re: mod_xsendfile problems

06 Feb 2013, 15:56

Thank you for your feedback

We are working on this issue. Hopefully fixed build of Helicon Ape will be available within 1-2 days.

User avatar
Posts: 1264
Joined: 07 Mar 2012, 10:16

Re: mod_xsendfile problems

07 Feb 2013, 01:31

Hello,

It's a known issue that after jrun_iis6_wildcard.dll the request processing in IIS stops, which means that Helicon Ape doesn't receive the events that are executed after the handler. Mod_xsendfile, in its turn, takes place after the handler.

This means that mod_xsendfile cannot work together with ColdFusion using jrun_iis6_wildcard.dll.

Also, instead of
Response.addHeader "Content-Disposition", "filename=main.gif"
please, use the following:
Code: Select all
Response.addHeader "Content-Disposition", "attachment;filename=main.gif"



Regards
Andrew Tyshchenko
HeliconTech Support Team

User avatar
Posts: 402
Joined: 06 Mar 2012, 11:59

Re: mod_xsendfile problems

07 Feb 2013, 08:45

I can add that instead of ColdFusion built-in IIS connector I suggest you to use Boncode IIS connector to connect Tomcat to IIS: http://tomcatiis.riaforge.org/
This connector is faster, more advanced and known to work fine with Helicon Ape.

User avatar
Posts: 2
Joined: 18 Mar 2013, 23:06

Re: mod_xsendfile problems

18 Mar 2013, 23:08

Any update on this? Is CF still not supported because of jrun_iis6_wildcard.dll?

@Yaroslav that might be a solution for the CF10 guys. Any workaround for CF9 and below (still using the legacy JRun)? Thanks.

User avatar
Posts: 2
Joined: 18 Mar 2013, 23:06

Re: mod_xsendfile problems

22 Mar 2013, 22:01

Good news, APE mod_xsendfile works with CF10!

At first I tried

Code: Select all
<Files out.cfm>
XSendFileAllowAbove On
XSendFile On
</Files>


and put the <cfheader>'s in out.cfm, it doesn't work. However when I take out the <files>

Code: Select all
XSendFileAllowAbove On
XSendFile On


It works! Apparently the handler in CF10 did not stop the request processing, but the files matching doesn't seem to work.

Log:

Code: Select all
[22/03/2013 6:08:29 PM] [1.2] (8) [/jakarta/isapi_redirect.dll] X-Sendfile: D:\hello.txt
[22/03/2013 6:08:29 PM] [1.2] (8) [/jakarta/isapi_redirect.dll] X-Sendfile: D:\hello.txt - OK

Return to Helicon Ape

Who is online

Users browsing this forum: No registered users and 14 guests