I am using okhttp to send http form to server . this is my request:
OkHttpClient client = new OkHttpClient();
RequestBody multiPartBody = new MultipartBody.Builder()
.setType(MultipartBody.FORM)
.addPart(
Headers.of("Content-Disposition", "form-data; name=\"file0\"; filename=\"" + name.split("\\.")[0] + "\""),
RequestBody.create(MediaType.parse(mediaType), new File(path)))
.addFormDataPart("RadUAG_fileName", name)
.addFormDataPart("RadUAG_position", "0")
Request request = new Request.Builder()
.url("http://xxx.xxx.xxx.xxx/ArchiveSite/Handlers/RadUploadHandler.ashx")
.post(multiPartBody)
.build();
client.newCall(request).execute()
Now imagine my file has big size and i want to show progress to user that how much of upload is sent to server.
How can i get a mount of file that sent to server and show to user progress bar?
As you can see i am using okhttp
and i want to find solution in this library.