06-02-2015 02:52 PM
public boolean UploadDocument()
{
String ticket = null;
ticket = this.getAlfticket(this.url,this.login,this.password);
if (ticket!=null)
{
String URL= this.url+"/service/api/upload/?alf_ticket="+ticket;
File file = this.ToFile(this.fileobj)
HttpClient client = new HttpClient();
PostMethod post = new PostMethod(URL);
Part[] parts = {
new FilePart("filedata", filename, file, filetype, null),
new StringPart("filename", filename),
new StringPart("description", "description"),
// new StringPart("destination", "workspace://SpacesStore/7118e242-86b1-489a-ac2e-193364ccf6e4"),
new StringPart("contenttype", "hula_type"),
new StringPart("departamento",this.departamento),
};
post.setRequestEntity(new MultipartRequestEntity(parts, post.getParams()));
int status = client.executeMethod(post);
System.out.println(post.getResponseBodyAsString());
post.releaseConnection();
return true;
}
else
{System.out.println("Not able to connect");}
}
// new StringPart("destination", "workspace://SpacesStore/7118e242-86b1-489a-ac2e-193364ccf6e4"),
06-10-2015 05:12 AM
06-12-2015 05:49 AM
06-15-2015 05:01 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.