02-24-2014 05:42 AM
02-24-2014 09:23 AM
{
"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.
02-25-2014 12:33 AM
02-26-2014 09:10 PM
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());
07-13-2017 01:11 AM
Could you please tell like how you did it. i am doing the same thing but could able to do
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.