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:
@ -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
|
||||
|
Reference in New Issue
Block a user