03-02-2016 08:20 PM
public void uploadDocument(String ticket, File fileobj,
String site, String desc, String title,
String destination) {
try {
String urlString = uriRepoApi + "upload?alf_ticket="
+ ticket;
logger.info("The upload url:::" + urlString);
HttpClient client = new HttpClient();
PostMethod mPost = new PostMethod(urlString);
Part[] parts = {
new FilePart("filedata", fileobj),
new StringPart("filename", fileobj.getName()),
new StringPart("description", desc),
new StringPart("title", title),
new StringPart("siteid", site),
new StringPart("containerid", "documentLibrary"),
new StringPart("uploaddirectory", destination)
};
mPost.setRequestEntity(new MultipartRequestEntity(parts, mPost
.getParams()));
int statusCode1 = client.executeMethod(mPost);
logger.info("statusLine>>>" + statusCode1 + "……"
+ "\n status line \n"
+mPost.getStatusLine() + "\nbody \n" +mPost.getResponseBodyAsString());
mPost.releaseConnection();
} catch (Exception e) {
System.out.println(e);
}
}
03-07-2016 07:46 PM
12-27-2016 06:20 AM
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.