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 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
> 

Reply via email to