From 423a0efd46221b93cd1d1d6207e3dd8d130fa125 Mon Sep 17 00:00:00 2001 From: infacc Date: Wed, 11 Oct 2023 13:37:27 +0200 Subject: [PATCH 1/2] fix: form-submit filename instead of file object --- qhana_plugin_runner/static/microfrontend.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/qhana_plugin_runner/static/microfrontend.js b/qhana_plugin_runner/static/microfrontend.js index 354701671..6641eb035 100644 --- a/qhana_plugin_runner/static/microfrontend.js +++ b/qhana_plugin_runner/static/microfrontend.js @@ -402,6 +402,11 @@ function onFormSubmit(event, dataInputs, privateInputs) { processedFormData.append(key, '***'); return; } + if (entry instanceof File) { + // add filename instead of file object + processedFormData.append(key, entry.name); + return; + } // add all other values unchanged processedFormData.append(key, entry); // add data inputs to extra list From fbf0277285bec523dde9e933fd21724a038382e8 Mon Sep 17 00:00:00 2001 From: infacc <33042539+infacc@users.noreply.github.com> Date: Wed, 11 Oct 2023 22:25:48 +0200 Subject: [PATCH 2/2] refactor: clarify that file comes from user MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Fabian Bühler --- qhana_plugin_runner/static/microfrontend.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qhana_plugin_runner/static/microfrontend.js b/qhana_plugin_runner/static/microfrontend.js index 6641eb035..3741ebb1f 100644 --- a/qhana_plugin_runner/static/microfrontend.js +++ b/qhana_plugin_runner/static/microfrontend.js @@ -404,7 +404,7 @@ function onFormSubmit(event, dataInputs, privateInputs) { } if (entry instanceof File) { // add filename instead of file object - processedFormData.append(key, entry.name); + processedFormData.append(key, `Uploaded file: ${entry.name}`); return; } // add all other values unchanged