I am trying these code from postman to upload an image into blobstore.
blobstore.ParseUpload(r) these method is not processing any request which is sending from postman.it is showing a null.
ERROR : I am getting an error like "NO FILE I UPLOADED"
func init() {
initKeys()
http.HandleFunc("/api/image/", handleUpload)
}
func handleUpload(w http.ResponseWriter, r *http.Request){
ctx := appengine.NewContext(r)
blobs, _, err := blobstore.ParseUpload(r)
log.Infof(ctx, "blobs blobs", blobs)
if err != nil {
serveError(ctx, w, err)
return
}
file := blobs["file"]
log.Infof(ctx, "file file", file)
if len(file) == 0 {
log.Errorf(ctx, "no file uploaded")
//http.Redirect(w, r, "/", http.StatusFound)
return
}
http.Redirect(w, r, "/serve/?blobKey="+string(file[0].BlobKey), http.StatusFound)
}