On Feb 13, 2004, at 1:45 AM, Bert Van Kets wrote:


Thanks for that bit of code mate. It's indeed a lot better.
Any idea on getting a fix on that realPath for converting the relative path
to the real server path??? I have tried loads of things and can't get it to
work. I still have to use the full path in the config.xconf file.

Hmmm... well, it looks like if you use a relative path there, it's relative to the working directory of the process that started the servlet container. I'm using Jetty on Unix, so YMMV. Anyway, I do this:


        <upload_manager>
                <uploadfolder>site/WEB-INF/work/upload</uploadfolder>
        </upload_manager>

I have a project directory set up like this:

        bin/                    -- contains startup script derived from cocoon.sh
        java/
        jetty-conf/
                main.xml
                webdefaults.xml
        logs/   
                httpd/
                cocoon/
                jetty/
        site/                   -- the webapp directory
        supervise/      -- for daemontools (http://cr.yp.to/daemontools.html)

The startup script is written to be invoked with this project directory as the working directory (that way I can re-use it across many projects, and the only difference between projects besides the webapp itself is the jetty-conf/main.xml).

OK, so all this is by way of explanation for why my servlet context directory happens to be the parent directory of the webapp :-)

Anyway, it works for me... :-)

To make the code totally perfect, we should add some exception handling in
the flowscript in case the file didn't make it to the server. That would
result in a nullpointer exception.

Why would you want an upload failure to result in an NPE?


Best Regards,
-- Mark



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to