From 16642c53f3f0df33a9ee0d681a92facca2ca185d Mon Sep 17 00:00:00 2001 From: whoswhip Date: Fri, 13 Nov 2026 14:54:47 -0500 Subject: [PATCH] use file extension even if there is no file extension no extra will be added (like a period .) because {{.FileExtension}} includes the "." --- static/js/copy.js | 2 +- templates/upload.html | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/static/js/copy.js b/static/js/copy.js index b08f444..1293964 100644 --- a/static/js/copy.js +++ b/static/js/copy.js @@ -6,7 +6,7 @@ if (link && navigator.clipboard?.writeText) { link.onclick = async (e) => { e.preventDefault(); try { - await navigator.clipboard.writeText(`${location.origin}/${link.dataset.id}`); + await navigator.clipboard.writeText(`${location.origin}/${link.dataset.id}${link.dataset.extension}`); link.textContent = "copied"; setTimeout(() => { link.textContent = "copy link"; diff --git a/templates/upload.html b/templates/upload.html index 0634b12..40460e4 100644 --- a/templates/upload.html +++ b/templates/upload.html @@ -12,11 +12,11 @@
{{if hasPrefix .MIMEType "image/"}} - + {{else if hasPrefix .MIMEType "video/"}} - + {{else if hasPrefix .MIMEType "audio/"}} - + {{else}}

{{.Filename}}

{{.ID}}{{.FileExtension}}

@@ -87,7 +87,7 @@ copying is only available with javascript we will make this element visible with javascript --> - +