Want to display particular file in page
Hi,
My requirement is to uploaded file should be display in page when ever i want to display pdf,ppt,doc, it should be display on page after clicking particular file name,below code i have writen but by default it is taking last condition am unable to display pdf file if i give jcr:content : property as::application/pdf then i can able to display pdf on page.
ResourceResolver resourceResolver = resolverFactory.getAdministrativeResourceResolver(null);
session = resourceResolver.adaptTo(Session.class);
Node node = session.getNode("/x/y/z/assets");
//System.out.println(node.getpath());
javax.jcr.ValueFactory valueFactory = session.getValueFactory();
javax.jcr.Binary contentValue = valueFactory.createBinary(is);
Node fileNode = node.addNode(fileName, "nt:file");
fileNode.addMixin("mix:referenceable");
Node resNode = fileNode.addNode("jcr:content", "nt:resource");
//String fileupld = "image/jpeg";
String fileupld = "application/x-mspowerpoint,application/x-compressed,application/excel,application/msword,application/pdf,text/plain,image/jpeg,";
That will be great for you answer