Hi all,

in my current project I need to _send_ large files to authorized users.
The server mustn't execute/display the files, even if it's a index.html.
The environment will be an Apache2-frontent, via mod_jk to a Tomcat
instance where Tapestry runs.

After some googleing I believe the best way to solve my problem this is
with mod_xsendfile. I've never used this before and since there seems to
be no documentation about this in Tapestry, I'm not sure how to
implement it the right way.

What I have now:

The component part:

    [...]
    @Property
    private FileReference fileReference; // from DB with paths, size, etc.
    @Inject
    private RequestGlobals requestGlobals;

    private void onActionFromSend() throws IOException {
            [... security checks ...]
           
requestGlobals.getHTTPServletResponse().setHeader("X-Sendfile",
fileReference.absolutePath());
            requestGlobals.getHTTPServletResponse().flushBuffer();
    }

The template part for this component:

<t:actionlink t:id="send"
target="_blank">${fileReference.fileName}</t:actionlink>

Unfortunately my Apache environment isn't set up yet so I couldn't try
it and don't know if it works. But the main question is: Is it OK to use
requestGlobals the way as it's done in the code above?
I'm not sure what this would mean for the request process flow
(https://tapestry.apache.org/request-processing.html). I think it would
be disrupted somewhere between ComponentRequestHandler and
ComponentRequestHandlerTerminator.

A confirmation/correction/hit would be great :-)

René

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to