PostMethod httpPost = new PostMethod(url);
RequestEntity requestEntity = null;
try {
FileInputStream message = new FileInputStream(filename);
Base64InputStream message64 = new Base64InputStream(message, true, -1, null);
requestEntity = new InputStreamRequestEntity(message64, "application/octet-stream");
} catch (FileNotFoundException e) {
Mediator.getLogger(CpadDataExtract.class.getName()).log(Level.SEVERE, "File not found.", e);
}
httpPost.setRequestEntity(requestEntity);