title: How to download multiple files from a single hyperlink
body: <p>I am working on a task where I need to download multiple files from a single hyperlink. When I call the one API link I want it to return multiple files.</p>
  
  <p>My current code is only downloading a single file:</p>
  
  <pre><code>try {
      URL url = new URL(f_url[0]);
      URLConnection conection = url.openConnection();
      conection.connect();
      // getting file length
      int lenghtOfFile = conection.getContentLength();
  
      // input stream to read file - with 8k buffer
      InputStream input = new BufferedInputStream(url.openStream(), 8192);
  
      // Output stream to write file
      OutputStream output = new FileOutputStream("/sdcard/downloadedfile.jpg");
  
      byte data[] = new byte[1024];
  
      long total = 0;
  
      while ((count = input.read(data)) != -1) {
          total += count;
          // publishing the progress....
          // After this onProgressUpdate will be called
          publishProgress(""+(int)((total*100)/lenghtOfFile));
  
          // writing data to file
          output.write(data, 0, count);
      }
  
      // flushing output
      output.flush();
  
      // closing streams
      output.close();
      input.close();
  
  } catch (Exception e) {
      Log.e("Error: ", e.getMessage());
  }
  </code></pre>