Use mime type when constructing file body for entity

pull/14/head
Sam Bosley 13 years ago
parent 1e7c7e20e0
commit 6ed1655653

@ -175,10 +175,11 @@ public class ChangesHappened<TYPE extends RemoteModel, OE extends OutstandingEnt
if (json.has("path")) { if (json.has("path")) {
String path = json.optString("path"); String path = json.optString("path");
String name = json.optString("name"); String name = json.optString("name");
String type = json.optString("type");
File f = new File(path); File f = new File(path);
if (f.exists() && !TextUtils.isEmpty(name)) { if (f.exists() && !TextUtils.isEmpty(name)) {
json.remove("path"); json.remove("path");
entity.addPart(name, new FileBody(f)); entity.addPart(name, new FileBody(f, type));
} }
} }
} }

Loading…
Cancel
Save