title: How to list files in a remote server
body: <p>I implemented a function to download files from a remote server.</p>
  
  <pre><code>func runDownload(fileName string) error {
      url := constants.REGISTRY_URL + "/" + constants.REGISTRY_ORGANIZATION + "/" + fileName + "/2.0.0-m1"
      if cellImage == "" {
          return fmt.Errorf("no fileName specified")
      }
  
      dir, err := filepath.Abs(filepath.Dir(os.Args[0]))
      if err != nil {
          fmt.Println("Error in getting current directory location: " + err.Error())
          os.Exit(1)
      }
      response, downloadError := util.DownloadFile(dir+"/"+fileName, url)
  
      if downloadError != nil {
          fmt.Printf("\x1b[31;1m Error occurred while pulling the cell image: \x1b[0m %v \n", downloadError)
          os.Exit(1)
      }
  
      if response.StatusCode == 200 {
          fmt.Printf("\r\033[32m Successfully pulled fileName \033[m %s \n", util.Bold(fileName))
      }
      if response.StatusCode == 404 {
          fmt.Printf("\x1b[31;1m Error occurred while running file:\x1b[0m %v not found in registry\n", cellImage)
      }
      return nil
  }
  </code></pre>
  
  <p>This calls a utility function and downloads a file.</p>
  
  <pre><code>func DownloadFile(filepath string, url string) (*http.Response, error) {
      transport := &amp;http.Transport{
          TLSClientConfig: &amp;tls.Config{InsecureSkipVerify: true},
      }
      client := &amp;http.Client{Transport: transport}
  
      resp, err := client.Get(url)
      if err != nil {
          return resp, err
      }
      defer resp.Body.Close()
  
      if resp.StatusCode == 200 {
          out, err := os.Create(filepath)
          if err != nil {
              return nil, err
          }
          defer out.Close()
          _, err = io.Copy(out, resp.Body)
          if err != nil {
              return nil, err
          }
      }
      return resp, nil
  }
  </code></pre>
  
  <p>This works fine and i am able to download a file. Now I want to list the details of the files uploaded. (Name, size)</p>