String mimeType = getContentType(items);
Connector connector = (Connector)
request.getSession().getAttribute(REPOSITORY_CONNECTOR);
try {
Session session = connector.find(repository).session(workspace);
ValueFactory valueFactory = session.getValueFactory();
Binary bin = valueFactory.createBinary(getStream(items));
Node node = session.getNode(path);
node.setProperty(pname, bin);