摘要:文件上传
- 前端后端文件交互
func upload(ctx echo.Context) error {
f,h,err := ctx.FormFile("file")
dst,_ := os.Create("filename", 0666)
io.Copy(dst, f)
f.Close()
dst.Close()
return nil
}
摘要:文件上传
func upload(ctx echo.Context) error {
f,h,err := ctx.FormFile("file")
dst,_ := os.Create("filename", 0666)
io.Copy(dst, f)
f.Close()
dst.Close()
return nil
}