title: How to get file size using retrofit 2 . I tried by return -1?
body: <p>I want to build App to download file with progress-bar and I tried to get file size from server. while using retrofit 2 library but failed to get the total-file size. and return -1, i tested its work on <strong><code>build:gradle:3.0.1</code></strong> but not in <strong><code>build:gradle:3.5.3</code></strong></p>
  
  <p><strong>here my code</strong></p>
  
  <pre><code>    ApiService apiService = RetroClient.getApiService();
      Call&lt;ResponseBody&gt; call = apiService.downloadFile("fsharpapps/fonts/customFont.ttf");
      call.enqueue(new Callback&lt;ResponseBody&gt;() {
          @Override
          public void onResponse(Call&lt;ResponseBody&gt; call, Response&lt;ResponseBody&gt; response) {
              if (response.isSuccessful()) {
                      if (response.body() != null) {
                          AppUtil.mToast(DownloadService.this, "Downloading...");
                          boolean isDownload = writeResponseBodyToDisk(response.body());
                          if (isDownload) 
                              AppUtil.mToast(DownloadService.this, "file size" + response.body().contentLength());
                        }}
          }
          @Override
          public void onFailure(Call&lt;ResponseBody&gt; call, Throwable t) {
          }
      });
  // output is file size -1
  </code></pre>
  
  <p>but when I check <strong>header</strong> file it working good.</p>
  
  <pre><code>here is HTTP Status for: "http://mywebsite.com/fsharpapps/fonts/customFont.ttf"
  
      HTTP/1.1 200 OK
      Date: Tue, 31 Dec 2019 19:03:16 GMT
      Server: Apache
      Upgrade: h2,h2c
      Connection: Upgrade, close
      Last-Modified: Sat, 21 Oct 2017 08:55:53 GMT
      Accept-Ranges: bytes
      Content-Length: 13857268
      Vary: Accept-Encoding,User-Agent
      Content-Type: font/ttf
  </code></pre>