From 5a99d8c5f4de7a8ca1caf1686bc8a318eb43c8c7 Mon Sep 17 00:00:00 2001 From: Jessica Rynkar <67977755+jessrynkar@users.noreply.github.com> Date: Wed, 13 Aug 2025 12:26:59 +0100 Subject: [PATCH] fix: upload with no filename gives vague error (#13414) ### What? Adds validation to the file upload field to ensure a filename is provided. If the filename is missing, a clear error message is shown to the user instead of a general error. ### Why? Currently, attempting to upload a file without a filename results in a generic error message: `Something went wrong.` This makes it unclear for users to understand what the issue is. ### How? The upload field validation has been updated to explicitly check for a missing filename. If the filename is undefined or null, the error message `A filename is required` is now shown. Fixes #13410 --- packages/ui/src/elements/Upload/index.tsx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/ui/src/elements/Upload/index.tsx b/packages/ui/src/elements/Upload/index.tsx index 475a9efd2..37ff56fcc 100644 --- a/packages/ui/src/elements/Upload/index.tsx +++ b/packages/ui/src/elements/Upload/index.tsx @@ -34,6 +34,10 @@ const validate = (value) => { return 'A file is required.' } + if (value && (!value.name || value.name === '')) { + return 'A file name is required.' + } + return true }