I'm trying to upload image to Google App Engine blobstore
.
Besides of file field, I have some other fields in the form (such as article title, content...).
I'm using the solution from this answer, it's working fine except error with unicode
for those other fields.
For example, "こんにちは"
become "$B$3$s$K$A$O(B"
when storing to datastore. What is the workaround for this issue?
Updated
Below is my code
func handleSave(w http.ResponseWriter, r *http.Request) {
c := appengine.NewContext(r)
blobs, other_fields, err := blobstore.ParseUpload(r)
if err != nil {
serveError(c, w, err)
return
}
id := other_fields["id"][0]
categoryId, _ := strconv.ParseInt(other_fields["category_id"][0], 10, 64)
title := string(other_fields["title"][0])
content := []byte(other_fields["content"][0])
image := blobs["file"]
// ...
}