This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// decode the content and save to storage path location | |
func decodeAndSave(content, storagePath string, w http.ResponseWriter) { | |
// decode the payload content | |
data, err := base64.StdEncoding.DecodeString(string(content)) | |
if err != nil { | |
fmt.Fprintf(w, "An error happened while decoding base64") | |
fmt.Println(err) | |
return | |
} |