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