解決HttpClient的FilePart上傳文件中使用中文名稱文件名亂碼問題



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

相關文章
相關標籤/搜索