diff --git a/web/fup/fupstatic/js/base.js b/web/fup/fupstatic/js/base.js index 3f3951a4c1..d76b9fd467 100644 --- a/web/fup/fupstatic/js/base.js +++ b/web/fup/fupstatic/js/base.js @@ -153,6 +153,14 @@ if (document.body.classList.contains('upload-page')) { for (const item of clipboardData.items) { if (item.kind === 'file') { uploadFile(item.getAsFile(), expiryEl.value); + } else if (item.kind === 'string') { + item.getAsString((data) => { + // This is a hack, we should do something... more sensible. + const uploadData = new Blob([data], { type: 'text/plain' }); + uploadData.name = 'clipboard.txt'; + + uploadFile(uploadData, expiryEl.value); + }); } } });