Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot upload file with leading white space in the filename #4823

Open
LaurensBurger opened this issue Nov 13, 2024 · 0 comments
Open

Cannot upload file with leading white space in the filename #4823

LaurensBurger opened this issue Nov 13, 2024 · 0 comments
Labels
bug Something isn't working triage Issue needs to be validated. Remove this label if the issue considered valid.

Comments

@LaurensBurger
Copy link
Collaborator

LaurensBurger commented Nov 13, 2024

Product versie / Product version

2.8.x

Customer reference

No response

Omschrijf het probleem / Describe the bug

image
upload:

{
    "url": "https://openforms.foo/api/v2/submissions/files/2ebb2aca-af3a-43a3-8af5-9242bb4bfb2b",
    "name": " mei 2024 .pdf",
    "size": 766150
}

json in validate request:

{
  "storage": "url",
  "name": " mei 2024 -9ef7ca02-e1fd-48a9-b8b5-1f62913bcef1.pdf",
  "url": "https://openforms.foo/api/v2/submissions/files/2ebb2aca-af3a-43a3-8af5-9242bb4bfb2b",
  "size": 766150,
  "type": "application/pdf",
  "data": {
    "url": "https://openforms.foo/api/v2/submissions/files/2ebb2aca-af3a-43a3-8af5-9242bb4bfb2b",
    "name": " mei 2024 .pdf",
    "size": 766150,
    "baseUrl": "https://openforms.foo/api/v2/",
    "project": "",
    "form": ""
  },
  "originalName": " mei 2024 .pdf"
}

response:

{
    "type": "https://open-forms.test.maykin.opengem.nl/fouten/ValidationError/",
    "code": "invalid",
    "title": "Invalid input.",
    "status": 400,
    "detail": "",
    "instance": "urn:uuid:8b71e061-f293-4519-9260-794367388b93",
    "invalidParams": [
        {
            "name": "data.bestandsupload.0.originalName",
            "code": "invalid",
            "reason": "De bestandsnaam komt niet overeen met de upload."
        }
    ]
}

Seems the leading white space is stripped when storing on the server
image

@LaurensBurger LaurensBurger added bug Something isn't working triage Issue needs to be validated. Remove this label if the issue considered valid. labels Nov 13, 2024
@LaurensBurger LaurensBurger changed the title Cannot upload file with white space as first part of the filename Cannot upload file with leading white space in the filename Nov 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working triage Issue needs to be validated. Remove this label if the issue considered valid.
Projects
None yet
Development

No branches or pull requests

1 participant