Preserve uploaded file extensions

This commit is contained in:
richjohnrambo
2026-09-07 16:13:20 +08:00
parent 35da3025a3
commit 8a9e202b56
8 changed files with 139 additions and 14 deletions
+1 -2
View File
@@ -139,8 +139,7 @@ func (fh *fshandler) Upload(fdef *types.FileDef, file io.Reader) (string, int64,
return "", 0, err
}
fname := fdef.Id
fname += media.ExtensionByMimeType(fdef.MimeType)
fname := media.FileURLName(fdef)
fdef.Location = location
// Use file path to create ETag. File paths are unique so will be the ETag.