package main import ( "github.com/gogf/gf/frame/g" "github.com/gogf/gf/net/ghttp" ) // Upload uploads files to /tmp . func Upload(r *ghttp.Request) { saveDirPath := "/tmp/" files := r.GetUploadFiles("file") if _, err := files.Save(saveDirPath); err != nil { r.Response.WriteExit(err) } r.Response.WriteExit("upload successfully") } // UploadShow shows uploading simgle file page. func UploadShow(r *ghttp.Request) { r.Response.Write(`