You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Ari King <ar...@gmail.com> on 2010/09/23 19:09:40 UTC

How to retrieve/serve upload files?

Hi,

I'm interested in learning how I can retrieve/serve files uploaded to my web
service. The only thing I could think of was to use apache's http server as
a proxy to serve these static files; but I'm not sure how I'd secure access
to the apache http server, in the case of my web service I'm using spring
security.

I'd appreciate suggestions/feedback on how others have solved this problem.

Thanks.

Best,
Ari

Re: How to retrieve/serve upload files?

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi

Not sure if it helps, but CXFServlet can be used to redirect to default (or
custom)  servlets, or even serve some resources itself, see
http://cxf.apache.org/docs/servlet-transport.html.

Another possibility is add few JAXRS annotations to a service bean and have
some resources served via multiparts, etc, too

cheers, Sergey

On Fri, Sep 24, 2010 at 7:43 AM, Josh Holtzman <jh...@berkeley.edu>wrote:

> You can serve files via a run-of-the-mill servlet from jetty, or even the
> default servlet.  We do this in an osgi environment, so we have access to
> the HttpService, but you can run something similar by setting up a jetty
> instance yourself.  I'm not sure what your setup looks like (osgi, spring,
> something else?), but this page [1] might help.
>
> We also use spring security, which is essentially an entire filter chain
> inside a filter, in front of the "download" servlet.  Serving the content
> from Java allows us to do other interesting things, too, like audit access
> attempts, track user clicks inside our user interfaces, etc, all from
> inside
> our application (as opposed to hooking up the in-JMV authentication with
> HTTPD's authentication and mining the apache access logs for this
> information).
>
> [1] http://cxf.apache.org/docs/jetty-configuration.html
>
> Hope that helps,
> Josh
>
> On Thu, Sep 23, 2010 at 7:09 PM, Ari King <ari.brandeis.king@gmail.com
> >wrote:
>
> > Hi,
> >
> > I'm interested in learning how I can retrieve/serve files uploaded to my
> > web
> > service. The only thing I could think of was to use apache's http server
> as
> > a proxy to serve these static files; but I'm not sure how I'd secure
> access
> > to the apache http server, in the case of my web service I'm using spring
> > security.
> >
> > I'd appreciate suggestions/feedback on how others have solved this
> problem.
> >
> > Thanks.
> >
> > Best,
> > Ari
> >
>

Re: How to retrieve/serve upload files?

Posted by Josh Holtzman <jh...@berkeley.edu>.
You can serve files via a run-of-the-mill servlet from jetty, or even the
default servlet.  We do this in an osgi environment, so we have access to
the HttpService, but you can run something similar by setting up a jetty
instance yourself.  I'm not sure what your setup looks like (osgi, spring,
something else?), but this page [1] might help.

We also use spring security, which is essentially an entire filter chain
inside a filter, in front of the "download" servlet.  Serving the content
from Java allows us to do other interesting things, too, like audit access
attempts, track user clicks inside our user interfaces, etc, all from inside
our application (as opposed to hooking up the in-JMV authentication with
HTTPD's authentication and mining the apache access logs for this
information).

[1] http://cxf.apache.org/docs/jetty-configuration.html

Hope that helps,
Josh

On Thu, Sep 23, 2010 at 7:09 PM, Ari King <ar...@gmail.com>wrote:

> Hi,
>
> I'm interested in learning how I can retrieve/serve files uploaded to my
> web
> service. The only thing I could think of was to use apache's http server as
> a proxy to serve these static files; but I'm not sure how I'd secure access
> to the apache http server, in the case of my web service I'm using spring
> security.
>
> I'd appreciate suggestions/feedback on how others have solved this problem.
>
> Thanks.
>
> Best,
> Ari
>