Add temporary token generation for secure file downloads

This commit is contained in:
2025-05-26 19:36:37 +08:00
parent 532b3ff8df
commit 764ec5f38c
3 changed files with 75 additions and 2 deletions

View File

@@ -403,6 +403,7 @@ func GetFile(fid string) (*model.FileView, error) {
return file.ToView(), nil
}
// DownloadFile handles the file download request. Return a presigned URL or a direct file path.
func DownloadFile(ip, fid, cfToken string) (string, string, error) {
passed, err := verifyCfToken(cfToken)
if err != nil {