HTTPCLIENT-1426: use File#getName() if filename is not explicitly given

git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1535114 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Oleg Kalnichevski 2013-10-23 18:37:55 +00:00
parent 65194e9d81
commit 2b31931ecf
1 changed files with 1 additions and 1 deletions

View File

@ -143,7 +143,7 @@ public class MultipartEntityBuilder {
public MultipartEntityBuilder addBinaryBody(
final String name, final File file) {
return addBinaryBody(name, file, ContentType.DEFAULT_BINARY, null);
return addBinaryBody(name, file, ContentType.DEFAULT_BINARY, file != null ? file.getName() : null);
}
public MultipartEntityBuilder addBinaryBody(