Skip to content

[Question]文件上传后怎么下载? #631

@a6652162

Description

@a6652162

Description [describe your questions]

我有一个表,记录一些信息,同时可上传文件,
info.AddField("文件", "file", db.Varchar)
formList.AddField("文件", "file", db.Varchar, form.File)
现文件可以上传,同时文件会存储到 r.Static("/uploads", "./uploads") uploads文件夹下。
那如果我想在这个表格上或是表单上可点击下载该文件,要怎么配置?
我找到可以在表格上添加Action操作,但我不知道怎么获取当前域名,和所操作行的文件名称,同时也不确定这个能不能正常下载。
有什么办法,可以实现上传后,可以正常下载?可以的话,在表单上添加一个操作,或是在文件名字段改为可点击下载。

Example code [If you have any code info]

Others [screenshots or other info]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions