html代码:

     <form >	
   		<input  />  
        <input type="submit" value="保存"  />
	</form>

 

beego代码:

func (this *ServiceController) Upload() {	
	f, h, _ := this.GetFile("myfile")                  //获取上传的文件
	path := SDPATH + h.Filename               //文件目录
	f.Close()                                          //关闭上传的文件,不然的话会出现临时文件不能清除的情况
	this.SaveToFile("myfile", path)                    //存文件    
}

  

相关文章:

  • 2022-12-23
  • 2021-11-25
  • 2022-12-23
  • 2022-12-23
  • 2021-08-15
  • 2021-12-31
  • 2021-08-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2023-01-11
  • 2022-01-05
  • 2021-08-28
  • 2022-12-23
相关资源
相似解决方案