mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-02-10 17:24:21 +01:00
🎨 Force download exported files https://github.com/siyuan-note/siyuan/pull/16796
Signed-off-by: Daniel <845765@qq.com>
This commit is contained in:
parent
a15494c3f3
commit
ff72ff1f27
1 changed files with 5 additions and 0 deletions
|
|
@ -269,6 +269,11 @@ func serveExport(ginServer *gin.Engine) {
|
|||
|
||||
// 应下载而不是查看导出的文件
|
||||
exportGroup.GET("/*filepath", func(c *gin.Context) {
|
||||
if strings.HasPrefix(c.Request.URL.Path, "/export/temp/") {
|
||||
c.File(filepath.Join(util.TempDir, c.Request.URL.Path))
|
||||
return
|
||||
}
|
||||
|
||||
filePath := strings.TrimPrefix(c.Request.URL.Path, "/export/")
|
||||
|
||||
decodedPath, err := url.PathUnescape(filePath)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue