Thanks.. But it does not add jcr:mixinTypes. I deleted the nt:file node and retried a few times since I found a bug report saying that setting jcr:mixinTypes only works for node creation, not modification..
I'm gonna create a servlet that handles file upload :P On Thu, Sep 16, 2010 at 2:48 PM, Justin Edelson <justinedel...@gmail.com>wrote: > This should be > <form method="POST" action="/path/to" enctype="multipart/form-data" > > <input type="file" name="./filename.jpg" /> > <input type="submit" value="upload" /> > <input type="hidden" name="./filename....@typehint" value="nt:file" /> > <input type="hidden" name="./filename.jpg/jcr:mixinTypes" > value="my:mixin" /> > </form> > > As it is below, you are setting the type of /path/to to nt:file, not > /path/to/filename.jpg. Same thing with the mixin declaration. > > HTH, > Justin > > On 9/16/10 11:24 AM, sam lee wrote: > > Hey, > > > > I am trying to upload a file to /path/to/filename.jpg > > /path/to/filename.jpg should be nt:file and have jcr:mixinTypes set to > > my:mixin. > > > > I am trying: > > <form method="POST" action="/path/to" enctype="multipart/form-data" > > > <input type="file" name="./filename.jpg" /> > > <input type="submit" value="upload" /> > > <input type="hidden" name="*...@typehint" value="nt:file" /> > > <input type="hidden" name="./jcr:mixinTypes" value="my:mixin" /> > > </form> > > > > > > This is what I get: > > javax.jcr.nodetype.ConstraintViolationException: /path/to: mandatory > child > > node > > {http://www.jcp.org/jcr/1.0}content<http://www.jcp.org/jcr/1.0%7Dcontent>does > > not exist > > > > What am I doing wrong? > > > > Should I create my own servlet to handle file uploading that should be > > mixin? > > If so, is there example of file uploading servlet? > > > > Thanks. > > Sam > > > >