Update TUS backend
All checks were successful
Publish Development Docker Image / Publish Development Docker Image (push) Successful in 1m34s

This commit is contained in:
2025-04-07 16:54:17 -04:00
parent d144f7385b
commit d13b16c032
9 changed files with 145 additions and 38 deletions

View File

@ -28,13 +28,9 @@ const PDF = ({ url, form = false }: PDFProps) => {
width: 'calc(100vw - 1rem)',
height: `calc(100vh - ${form ? '8.5rem' : '6rem'})`,
}}
allowFullScreen
className="rounded-xl"
onError={() => setError(true)}
onLoad={() => setError(false)}
sandbox="allow-same-origin allow-scripts allow-forms allow-popups"
referrerPolicy="no-referrer-when-downgrade"
loading="lazy"
/>
)
}

View File

@ -53,7 +53,7 @@ const Uploader = ({
onBeforeUpload: (files) => {
for (const [key, file] of Object.entries(files)) {
instance.setFileMeta(key, {
name: new Date().getTime().toString(),
name: `${new Date().getTime().toString()}.${file.extension}`,
type: file.type,
contentType: file.type,
})
@ -68,7 +68,7 @@ const Uploader = ({
removeFingerprintOnSuccess: true,
})
.use(Compressor, {
mimeType: 'image/webp',
mimeType: type === 'image' ? 'image/webp' : 'application/pdf',
})
if (type === 'image')