/* * @Author: liling * @Date: 2022-08-13 14:38:13 * @LastEditors: liling * @LastEditTime: 2022-08-13 14:38:15 * @FilePath: \police_security\controllers\exelController.go * @Description:excel导入导出相关控制器 * * Copyright (c) 2022 by liling/jujutong, All Rights Reserved. */ package controllers type FileDownController struct { BaseController } func init() { } //公用文件下载方法 //可通过该方法实现对目标文件进行下载权限、过虑、记录等操作 func (this *FileDownController) Get() { //图片,text,pdf文件全部在浏览器中显示了,并没有完全的实现下载的功能 //this.Redirect("/static/img/1.jpg", 302) //第一个参数是文件的地址,第二个参数是下载显示的文件的名称 this.Ctx.Output.Download("static/img/1.jpg", "tu1.jpg") }