filesharing/views/download.pug
2022-09-07 00:01:56 +08:00

33 lines
998 B
Plaintext

extends layout
block main
p
a(href='/') 返回首页
form(method='POST')
label 文件
label= file.filename
label 类型
label= file.mimetype
label 大小
label= filesize(file.size)
label 上传
label= moment(file.createdAt).fromNow()
label 热度
label= file.downloads
|   次下载
if file.password
label(for='password_input') 密码
input(id='password_input' name='password' type='password' autocomplete='off' required)
button(id='download_button' type='submit') 下载
if !file.password
- const mimetype = file.mimetype.split('/')[0]
- const src = '/file/' + file.md5
if mimetype == 'image'
p 预览
img(src=src)
if mimetype == 'audio'
p 预览
audio(controls src=src)
if mimetype == 'video'
p 预览
video(controls src=src)