Cannot upload pictures to design folder using Tools | Community
Skip to main content
Xena_bcn
February 3, 2016
Solved

Cannot upload pictures to design folder using Tools

  • February 3, 2016
  • 4 replies
  • 1545 views

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?

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Xena_bcn

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.

4 replies

kautuk_sahni
Community Manager
Community Manager
February 3, 2016

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-definition-for-ch-td3332839.html

// 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-inside.html

//

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
Xena_bcn
Xena_bcnAuthor
February 3, 2016

thank you a lot...

 

i will try it and let you know.

 

have a nice day

Xena_bcn
Xena_bcnAuthor
February 3, 2016

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

Xena_bcn
Xena_bcnAuthorAccepted solution
February 17, 2016

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.