mirror of
https://github.com/halejohn/Cloudreve.git
synced 2026-01-26 09:34:57 +08:00
Feat: file download in service level
This commit is contained in:
@@ -18,9 +18,10 @@ func (service *FileDownloadService) Download(ctx context.Context, c *gin.Context
|
||||
fs, err := filesystem.NewFileSystemFromContext(c)
|
||||
if err != nil {
|
||||
return serializer.Err(serializer.CodePolicyNotAllowed, err.Error(), err)
|
||||
|
||||
}
|
||||
|
||||
// 开始处理下载
|
||||
ctx = context.WithValue(ctx, filesystem.GinCtx, c)
|
||||
_, err = fs.Download(ctx, service.Path)
|
||||
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user