Expand my Community achievements bar.

SOLVED

Cannot upload pictures to design folder using Tools

Avatar

Level 6

I need to upload just 2 new icons to design folder

but as this folder is of type   nt:folder

i can not upload any file.

As I get ConstraintViolationException: no matching child node definition found

 

Please help...

Is it possible to change folder type?

1 Accepted Solution

Avatar

Correct answer by
Level 6

The solution i got from someone who is  experienced with ADOBE AEM:

copy pictures to the appropriate folder inside the project

use maven build to deploy them directly to the server.

 

that worked!

 

thank you all for help.

View solution in original post

4 Replies

Avatar

Administrator

Hi 

Please have a look at couple of articles, this might will help you:-

Link 1:-  http://jackrabbit.510166.n4.nabble.com/javax-jcr-nodetype-ConstraintViolationException-No-child-node...

// Underneath a node of type nt:folder you can only add a child node that 
extends the type nt:hierarchyNode (nt:file, nt:folder or nt:linkedFile) but 
not a node of type nt:unstructured. 

If you would change that or change the type of the sub node then you will 
probably succeed. 

 

Link 2:- https://www.jahia.com/home/resources/forum/jahia-developer/jahia-dev-forum/how-to-create-child-node-...

//

JCRNodeWrapper FFolder = session.getNode("/sites/demo/files").addNode("css", "jnt:folder");

FFolder.uploadFile("myFile.pdf", inputStream, "application/pdf");

session.save();

 

I hope this would help you.

Thanks and Regards

Kautuk Sahni



Kautuk Sahni

Avatar

Level 6

thank you a lot...

 

i will try it and let you know.

 

have a nice day

Avatar

Level 6

i created this HTML

 

<form action="http://localhost:4502/etc/designs/ourproject/static/images/*" method="POST" enctype="multipart/form-data">
<input name="./new_file.png" type="file">

<input name="./jcr:primaryType" value="nt:file" type="hidden">
<input name="./jcr:content/jcr:primaryType" value="nt:resource" type="hidden">
<input name="./jcr:content/jcr:mixinTypes" value="cq:ReplicationStatus" type="hidden">
<input name="./jcr:content/jcr:mimeType" value="image/png" type="hidden">
<input name="./jcr:content/jcr:data" value="view" type="hidden">

<input type="submit">
</form>

 

but still get the same error on Submit

Avatar

Correct answer by
Level 6

The solution i got from someone who is  experienced with ADOBE AEM:

copy pictures to the appropriate folder inside the project

use maven build to deploy them directly to the server.

 

that worked!

 

thank you all for help.