diff --git a/web/fup/fupstatic/js/base.js b/web/fup/fupstatic/js/base.js index 0ce8d2405c..3f3951a4c1 100644 --- a/web/fup/fupstatic/js/base.js +++ b/web/fup/fupstatic/js/base.js @@ -147,4 +147,13 @@ if (document.body.classList.contains('upload-page')) { uploadFile(f, expiryEl.value); } }, false); + document.body.addEventListener('paste', (e) => { + e.preventDefault(); + const clipboardData = e.clipboardData || window.clipboardData; + for (const item of clipboardData.items) { + if (item.kind === 'file') { + uploadFile(item.getAsFile(), expiryEl.value); + } + } + }); }