allow file ext in download

This commit is contained in:
cirroskais 2024-07-06 02:09:19 -04:00
parent 5468158b51
commit a47d18d290
No known key found for this signature in database
GPG key ID: 5FC73EBF2678E33D
4 changed files with 6 additions and 4 deletions

View file

@ -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 ."

View file

@ -10,7 +10,6 @@
import { onMount } from 'svelte';
export let data;
console.log(data);
user.set(data?.user);
let input: HTMLInputElement,

View file

@ -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' });

View file

@ -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}