Skip to content

Commit 91a870d

Browse files
committed
Fix for upload
1 parent 783d8eb commit 91a870d

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/main/java/cy/ac/ucy/cs/anyplace/lib/Anyplace.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,8 @@ public String uploadRssLog(String access_token, String rsslog) {
331331
return JsonHelper.jsonResponse(response !=null? STATUS_OK: STATUS_ERR, response != null? response: "{\"message\":\"ERROR in Uploading RSS log\"}");
332332
}
333333

334+
335+
334336
/**
335337
* Get all POIs inside of a building
336338
*

src/main/java/cy/ac/ucy/cs/anyplace/lib/RestClient.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ public String uploadFile(String host, String path, File file, String access_tok
142142
.addFormDataPart("access_token", access_token)
143143
.addFormDataPart("radiomap", file.getName(),
144144
RequestBody.create(MediaType.parse("application/octet-stream"), file))
145+
.addFormDataPart("json","{}")
145146
.build();
146147

147148
Request request = new Request.Builder()
@@ -150,6 +151,7 @@ public String uploadFile(String host, String path, File file, String access_tok
150151
.build();
151152

152153

154+
153155
try {
154156
Response response = client.newCall(request).execute();
155157

@@ -163,6 +165,9 @@ public String uploadFile(String host, String path, File file, String access_tok
163165

164166
}
165167

168+
169+
170+
166171
/**
167172
* @param host The name of the server
168173
* @param url The full url for the file we wish to request

0 commit comments

Comments
 (0)