// Stores Files encoded into r.Body
Stores Files encoded into r.Body
// Stores Files encoded into r . Body
func uploadHandler(w http.ResponseWriter, r *http.Request, contentType string) {
	var files []ContentFile
	decoder := json.NewDecoder(r.Body)
	err := decoder.Decode(&files)
	if err != nil {
		logrus.Errorf("could not decode "+strings.ToLower(contentType)+" json, err: %s", err)
		return
	}
	err = addFiles(files, contentType)
	if err != nil {
		AddErrFlashQuick(w, r, contentType+"(s) could not be added")
		return
	}
	AddFlashQuick(w, r, contentType+"(s) added successfully!")
}
func uploadHandler ( w http . ResponseWriter , r * http . Request , contentType string ) { var files [ ] ContentFile decoder := json . NewDecoder ( r . Body ) err := decoder . Decode ( & files ) if err != nil { logrus . Errorf ( " " + strings . ToLower ( contentType ) + " " , err ) return } err = addFiles ( files , contentType ) if err != nil { AddErrFlashQuick ( w , r , contentType + " " ) return } AddFlashQuick ( w , r , contentType + " " ) }
Stores Files encoded into r.Body
Stores Files encoded into r . Body