String targetUrl = "http://localhost:8080/Test"; PostMethod filePost = new PostMethod(targetUrl) {//这个用来中文乱码 public String getRequestCharSet() { return "UTF-8";// } }; try { HttpClient client = new HttpClient(); File file = new File("c:/新闻.xml"); Part[] parts = new Part[] {new CustomFilePart(file.getName(), file)}; file
