title: Upload object to Google Firebase Cloud Storage with Content Length
body: <p>I want to upload the file to Google Firebase Cloud Storage with Content-Length and retrieve it from Android HttpURLConnection, but now when I'm receiving the storage object through the below URL, it's not returning the Content-Length instead I'm getting -1.</p>
  <pre><code>https://storage.googleapis.com/BUCKET_NAME/PATH
  </code></pre>
  <p>Even I've added all the required headers as below.</p>
  <pre class="lang-js prettyprint-override"><code>connection.setRequestProperty(&quot;Accept-Encoding&quot;, &quot;identity&quot;);
  </code></pre>
  <p>My upload source code,</p>
  <pre class="lang-js prettyprint-override"><code>admin.storage().bucket().upload(file, {
      destination: 'some_path/some_file.ext',
      public: true,
      gzip: true,
      metadata: {
          cacheControl: 'public, max-age=0',
      }
  })
  </code></pre>
  <p>Java code from Android</p>
  <pre class="lang-java prettyprint-override"><code>        int fileLength = connection.getContentLength();
          InputStream input = new BufferedInputStream(url.openStream());
          OutputStream output = new FileOutputStream(strings[1]);
          byte data[] = new byte[1024];
          long total = 0;
          int count;
          // TODO
          publishProgress(1);
          while ((count = input.read(data)) != -1) {
              total += count;
              if (fileLength &gt; 0) {
                  int progress = (int) (total * 100 / fileLength);
                  publishProgress(progress);
              }
              output.write(data, 0, count);
          }
          output.flush();
          output.close();
          input.close();
  </code></pre>