// Download file from url.
// Downloaded file stored in temporary directory
Download file from url.
Downloaded file stored in temporary directory
// Download file from url . // Downloaded file stored in temporary directory
func downloadFromUrl(url string) (fileName string, err error) {
	file, err := ioutil.TempFile(os.TempDir(), NAME)
	if err != nil {
		return
	}
	defer file.Close()
	fileName = file.Name()
	response, err := http.Get(url)
	if err != nil {
		return
	}
	defer response.Body.Close()
	_, err = io.Copy(file, response.Body)
	if err != nil {
		return
	}
	return
}
func downloadFromUrl ( url string ) ( fileName string , err error ) { file , err := ioutil . TempFile ( os . TempDir ( ) , NAME ) if err != nil { return } defer file . Close ( ) fileName = file . Name ( ) response , err := http . Get ( url ) if err != nil { return } defer response . Body . Close ( ) _ , err = io . Copy ( file , response . Body ) if err != nil { return } return }
Download file from url.
Download file from url .