On Tue, Nov 17, 2009 at 23:21, Juerg Meier <j...@proxymit.net> wrote: > On Tuesday 17 November 2009 08:11:18 Felix Meschberger wrote: >> Hi, >> >> Juerg Meier schrieb: >> > Hi all, >> > >> > I wonder if it is possible to upload a file and the pertaining metadata >> > in one pass. >> > >> > I defined a nodetype my:file > nt:file, with an additional multi value >> > string property 'my:tag'. >> > >> > In the post,I do the following: >> > >> > <form....> >> > ... >> > <input type="file" name="./*" size="80" maxlength="128"/> >> > <input name="my:tag" type="text" > >> > <input name="my:tag" type="text" > >> > <input type="hidden" name="./*...@typehint" value="my:file"> >> >> My guess is that this should probably be: >> <input type="hidden" name="jcr:primaryType" value="my:file"> >> >> The @TypeHint notation is used to provide property type hints for >> properties. To assign node types a regular jcr:primaryType property may >> be used (and jcr:mixinTypes for mixin node types, if required). > > I had tried the jcr:primaryType option already. It does not show any effect, > that is, I get an nt:file node. With @TypeHint, I get a my:file node at > least. That includes an my:tag property, but this is left empty, as described > above.
I think in your case it must be <input type="hidden" name="./jcr:primaryType" value="my:file"> because once you use "./" in any parameter, the Sling post servlet will ignore all parameters that don't start with "./". This is dirty little trick to automatically ignore foreign and unwanted parameters. Regards, Alex -- Alexander Klimetschek alexander.klimetsc...@day.com