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:
parent
65194e9d81
commit
2b31931ecf
|
@ -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(
|
||||
|
|
Loading…
Reference in New Issue