1
0
mirror of https://github.com/astaxie/beego.git synced 2025-07-12 09:51:01 +00:00

add GetFIle & enhance router

This commit is contained in:
astaxie
2013-04-09 23:33:48 +08:00
parent f9e8b4f124
commit 2f02653b7d
2 changed files with 32 additions and 3 deletions

View File

@ -7,6 +7,7 @@ import (
"github.com/astaxie/beego/session"
"html/template"
"io/ioutil"
"mime/multipart"
"net/http"
"net/url"
"path"
@ -191,6 +192,10 @@ func (c *Controller) GetBool(key string) (bool, error) {
return strconv.ParseBool(c.Input().Get(key))
}
func (c *Controller) GetFile(key string) (multipart.File, *multipart.FileHeader, error) {
return c.Ctx.Request.FormFile(key)
}
func (c *Controller) StartSession() (sess session.SessionStore) {
sess = GlobalSessions.SessionStart(c.Ctx.ResponseWriter, c.Ctx.Request)
return