我设法通过使用中间返回参数“其他”解决了我的问题。以下这些代码位于上传处理程序中
blobs, other, err := blobstore.ParseUpload(r)
然后分配相应的formkey
file := blobs["file"]**name := other["name"]** //name is a form field**description := other["description"]** //descriptionis a form field
并在我的结构值分配中像这样使用它
newdata:= data{ Name: **string(name[0])**, Description: **string(description[0])**, Image: string(file[0].BlobKey), }datastore.Put(c, datastore.NewIncompleteKey(c, "data", nil), &newData )并非100%肯定这是正确的做法,但这解决了我的问题,它现在将图像上传到blobstore,并将其他数据和blobkey保存到数据存储。
希望这也可以帮助其他人。



