// WithProgress Download from an external URL to a local location, with progress
WithProgress Download from an external URL to a local location, with progress
// WithProgress Download from an external URL to a local location with progress
func WithProgress(title string, url string, dest string, logCode string) error {
	log.Debug(logCode, "Downloading %v to %v", url, dest)
	err := os.MkdirAll(filepath.Dir(dest), os.ModePerm)
	if err != nil {
		return err
	}
	output, err := os.Create(dest)
	if err != nil {
		return err
	}
	defer output.Close()
	response, err := proxy.ProxyCapableClient.Get(url)
	if err != nil {
		return err
	}
	defer response.Body.Close()
	_, err = io.Copy(output,
		progress.NewProgressAwareReader(response.Body, title, logCode, response.ContentLength))
	if err != nil {
		return err
	}
	return nil
}
func WithProgress ( title string , url string , dest string , logCode string ) error { log . Debug ( logCode , " " , url , dest ) err := os . MkdirAll ( filepath . Dir ( dest ) , os . ModePerm ) if err != nil { return err } output , err := os . Create ( dest ) if err != nil { return err } defer output . Close ( ) response , err := proxy . ProxyCapableClient . Get ( url ) if err != nil { return err } defer response . Body . Close ( ) _ , err = io . Copy ( output , progress . NewProgressAwareReader ( response . Body , title , logCode , response . ContentLength ) ) if err != nil { return err } return nil }
WithProgress Download from an external URL to a local location, with progress
WithProgress Download from an external URL to a local location with progress