func DownloadData(url string, filePath string) error {
	resp, err := http.Get(url)
	if err != nil {
		return err
	}
	defer resp.Body.Close()
	if resp.StatusCode != http.StatusOK {
		return fmt.Errorf("error %d downloading file at %s", resp.StatusCode, url)
	}
	f, err := os.Create(filePath)
	if err != nil {
		return err
	}
	n, err := io.Copy(f, resp.Body)
	if err != nil {
		return err
	}
	fmt.Printf("Wrote %d bytes to file %s\n", n, filePath)
	return nil
}
DownloadData retrieves a file from the server and saves contents at filePath
package client
import (
	"bytes"
	"fmt"
	"io"
	"mime/multipart"
	"net/http"
	"os"
)