allow file ext in download
This commit is contained in:
parent
5468158b51
commit
a47d18d290
4 changed files with 6 additions and 4 deletions
|
@ -4,7 +4,7 @@
|
|||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "vite dev",
|
||||
"build": "BODY_SIZE_LIMIT=10737418240 vite build",
|
||||
"build": " vite build",
|
||||
"preview": "vite preview",
|
||||
"lint": "prettier --check .",
|
||||
"format": "prettier --write ."
|
||||
|
|
|
@ -10,7 +10,6 @@
|
|||
import { onMount } from 'svelte';
|
||||
|
||||
export let data;
|
||||
console.log(data);
|
||||
user.set(data?.user);
|
||||
|
||||
let input: HTMLInputElement,
|
||||
|
|
|
@ -3,7 +3,9 @@ import minio, { BUCKET } from '$lib/server/minio';
|
|||
import { error } from '@sveltejs/kit';
|
||||
|
||||
export const GET = async ({ params, locals }) => {
|
||||
const id = params.id;
|
||||
let id: any = params.id.split('.');
|
||||
if (id.length > 1) id.pop();
|
||||
id = id.join('');
|
||||
|
||||
const file = await getUpload(id);
|
||||
if (!file) throw error(404, { status: 404, message: 'File Not Found' });
|
||||
|
|
|
@ -14,7 +14,8 @@
|
|||
<meta property="og:site_name" content="cirro's file uploader" />
|
||||
<meta name="theme-color" content={data.settings.color} />
|
||||
{#if data.file.type.includes('video')}
|
||||
<meta property="og:video" content="{$page.url.origin}/download/{data.file.id}" />
|
||||
<meta property="og:type" content="video.other" />
|
||||
<meta property="og:video:url" content="{$page.url.origin}/download/{data.file.id}" />
|
||||
{:else if data.file.type.includes('image')}
|
||||
<meta property="og:image" content="{$page.url.origin}/download/{data.file.id}" />
|
||||
{/if}
|
||||
|
|
Loading…
Reference in a new issue