This is my first time using a multipart form to post data to an HTML form post. I am not sure if I am missing something, but I get no errors and the script completes as far as I can tell, but no data is added to the server the file is submitted to. Am I missing something from the code below
public static void main(String[] args) throws IOException { try { File f = new File("C://xxxxx/test.txt"); PostMethod postMessage = new PostMethod("xxxxxxx"); Part[] parts = { new FilePart(f.getName(), f) }; postMessage.setRequestEntity(new MultipartRequestEntity(parts, postMessage.getParams())); HttpClient client = new HttpClient(); client.executeMethod(postMessage); System.out.print("Test"); } catch (HttpException e) { // TODO Auto-generated catch block e.printStackTrace(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } }