func (f *Files) SaveFileREST(rw http.ResponseWriter, r *http.Request) {
	vars := mux.Vars(r)
	id := vars["id"]
	fn := vars["filename"]
	f.log.Info("Handle RESTful POST", "id", id, "filename", fn)
	err := f.saveFile(id, fn, rw, r.Body)
	if err != nil {
		return
	}
	resp := map[string]string{}
	resp["status"] = "200"
	resp["message"] = "ok"
	json.NewEncoder(rw).Encode(resp)
}
SaveFileREST saves the contents of the request to a file from the request
package handlers
import (
	"encoding/json"
	"io"
	"net/http"
	"path/filepath"
	"github.com/PacktPublishing/Building-Microservices-with-Go-Second-Edition/product-images/1_restful/files"
	"github.com/gorilla/mux"
	"github.com/hashicorp/go-hclog"
)
type Files struct {
	log     hclog.Logger
	store   files.Storage
	maxSize int64
}
func NewFiles(s files.Storage, maxSize int64, l hclog.Logger) *Files {
	return &Files{store: s, maxSize: maxSize, log: l}
}