jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexander Klimetschek" <aklim...@day.com>
Subject Re: Can i forward a InputStream object to Jackrabbit to handle File Upload
Date Mon, 01 Sep 2008 07:59:32 GMT
You should create a node of nt:file, add the jcr:content subnode and
set the jcr:data property with the file input stream you have
(setProperty with input stream value). Then you call session.save()
and the inputstream will be copied into Jackrabbit's persistency
layer.

To handle all cases (and problems) with file-uploads properly, you
typically need a separate library, such as apache commons-fileupload
or something in the Spring MVC library. Jackrabbit (apart from WebDAV)
does not include a web-layer as such. For that you might want to take
a look at Apache Sling (http://incubator.apache.org/sling).

Regards,
Alex

On Mon, Sep 1, 2008 at 9:49 AM, tung vu duc <tunggad@yahoo.com> wrote:
> I have on a .jsp page something:
>
> <form method="post" action="contextPath/.../save" enctype="multipart/form-data">
>      <input type="file" name="file"/>
>
>    <input type="submit"/>
> </form>
>
> I use Spring MVC on Serverside. In a controller i have a controller with save() Method
as action that looks like:
>
> InputStream input = request.getFile("file").inputStream;
>
> My question ist now how can i forward this InputStream object to Jackrabbit and Jackrabbit
should handle the Upload itself.
> Jackrabbit is deployed with 3. Model, as a dedicated CR in a seperate machine.
>
> Thanks in advances!
>
>
>
>
>



-- 
Alexander Klimetschek
alexander.klimetschek@day.com

Mime
View raw message