//保存 func (this *EpisodeController) Save(episode models.Episode) revel.Result { episode.Author, _ = strconv.ParseInt(this.Session["userId"], 10, 0) //上传文件 saveFile(this.Request, "attach", path.Join(revel.BasePath, "attach")) fmt.Println(path.Join(revel.BasePath, "attach")) if !episode.Save(this.q) { this.Flash.Error("保存错误") } return this.Redirect(routes.EpisodeController.QueryDetail(episode.Id)) }