Error with non-ascii chars in attachment filenames

Hi

We are having problems with attachments containing non-ascii chars in the filename. If the user responding a questionnaire uploads a file containing non-ascii chars in the filename (eg. "test_image_áéíóú.jpg"), the file is sucessfuly uploaded, but after that it's not possible to retrieve this file anymore either using Odk Central UI or through the Odk Central API. When trying to retrieve the file, the following error occurs:

  "message": "Completely unhandled exception: Invalid character in header content [\"Content-Disposition\"]",
  "details": {
    "stack": [
      "TypeError [ERR_INVALID_CHAR]: Invalid character in header content [\"Content-Disposition\"]",
      "at ServerResponse.setHeader (_http_outgoing.js:458:3)",
      "at ServerResponse.header (/usr/odk/node_modules/express/lib/response.js:767:10)",
      "at /usr/odk/lib/util/http.js:74:12",
      "at finalize (/usr/odk/lib/http/endpoint.js:52:20)",
      "at /usr/odk/lib/http/endpoint.js:142:25",
      "at processTicksAndRejections (internal/process/task_queues.js:85:5)"
    ]
  }
} 

We run ODK Central server v.1.2.1 using the docker images on a GCP Compute Engine VM (e2-medium) running Linux Debian 10

So far, the only thing we can do to avoid the problem is to instruct the users to not use filenames with non-ascii characters.

How to reproduce the problem:

To reproduce the problem, you need any form with attachments and while answering the questionnaire choose a file with special chars (eg. test_image_áéíóú.jpg) to upload. After the upload and submission is successful, try to download the file through ODK Central UI.

Please, if you need any other information, let me know.

Kind regards,
Marcelo

3 Likes

Thanks for reporting this issue, @mdrudi! We thought we resolved this issue in v1.2, but it looks like we'll need to take another look. I've created a GitHub issue for this here: https://github.com/getodk/central-backend/issues/389

2 Likes

Thanks Matthew.

I already subscribed to the github thread.

Please let me know if I you or the team need any additional information.

Kind regards,
Marcelo

1 Like

Thanks! It seems that it will be in the next release :heart_eyes:

1 Like

This has been fixed in v1.3. Submission attachments and other downloadable files can now have Unicode in their filenames. Thank you for reporting this issue!

1 Like