As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
{ "nodeRef": "workspace://SpacesStore/0aebff95-cbeb-4b2c-adce-0d6ab90019d2", "fileName": "userguide.pdf", "status": { "code": 200, "name": "OK", "description": "File uploaded successfully" } } by parsing it you'll get node uuid. You can specify content type by useing contentType parameter.
String urlString = "http://localhost:8080/alfresco/service/api/upload?alf_ticket=" + authTicket; HttpClient client = new HttpClient(); PostMethod mPost = new PostMethod(urlString); File fileobj = new File("C:/userguide.pdf"); Part[] parts = { new FilePart("filedata", filename, fileobj, filetype, null), new StringPart("filename", filename), new StringPart("description", description), // new StringPart("destination", destination), new StringPart("description", description), // modify this according to where you wanna put your content new StringPart("siteid", "kaynezhang"), new StringPart("containerid", "documentLibrary"), // new StringPart("uploaddirectory", "/Company Home") }; mPost.setRequestEntity(new MultipartRequestEntity(parts, mPost .getParams())); int statusCode1 = client.executeMethod(mPost); System.out.println("statusLine>>>" + statusCode1 + "……" + "\n status line \n" + mPost.getStatusLine() + "\nbody \n" + mPost.getResponseBodyAsString());
Could you please tell like how you did it. i am doing the same thing but could able to do