fix download file ext
This commit is contained in:
parent
1fda2ff1f6
commit
d9ed3ffe15
@ -51,7 +51,7 @@ r.get('/download', async c => {
|
|||||||
|
|
||||||
const fileInfo = store.get(file)
|
const fileInfo = store.get(file)
|
||||||
let fn = file
|
let fn = file
|
||||||
if (fileInfo !== null && 'title' in fileInfo) fn = fileInfo.title
|
if (fileInfo !== null && 'title' in fileInfo) fn = `${fileInfo.title}.mp3`
|
||||||
|
|
||||||
const rs = fs.createReadStream(fp)
|
const rs = fs.createReadStream(fp)
|
||||||
c.set('Content-disposition', `attachment; filename="${encodeURIComponent(fn)}"; filename*="utf8''${encodeURIComponent(fn)}";`)
|
c.set('Content-disposition', `attachment; filename="${encodeURIComponent(fn)}"; filename*="utf8''${encodeURIComponent(fn)}";`)
|
||||||
|
Loading…
Reference in New Issue
Block a user