Apache HttpClient を使用して MultipartEntity を介してファイルをアップロードしています。別のファイル名でファイルをアップロードする必要があります。以下は私のコードです...
FileBody uploadFilePart = new FileBody(binaryFile);
MultipartEntity reqEntity = new MultipartEntity();
reqEntity.addPart("bin", uploadFilePart);
reqEntity.addPart("comment", comment);
httpPost.setEntity(reqEntity);
HttpResponse response = httpclient.execute(httpPost);
HttpEntity resEntity = response.getEntity();
System.out.println("----------------------------------------");
System.out.println(response.getStatusLine());
if (resEntity != null) {
System.out.println("Response content length: " +
resEntity.getContentLength());
}
EntityUtils.consume(resEntity);
助けて感謝!
ありがとう、シュレズ