msupply-foundation / conforma-server

Conforma application manager (IRIMS) back-end
GNU Affero General Public License v3.0
4 stars 1 forks source link

File server can't handle files with illegal characters in filename #1100

Open CarlosNZ opened 1 month ago

CarlosNZ commented 1 month ago

Suggested fix -- in "fileUpload" element, strip out any illegal characters on upload and save them with modified filenames.

Legal chars should be restricted to letters,numbers, space, and underscore (what about åccénted letters? -- need to test)

Illegal chars should be replaced with underscores, probably.

CarlosNZ commented 1 month ago

Alternate solution was to correctly escape the file names (percent-escaping) before sending them to the sendFile method. Working correctly now, so no need to restrict incoming file names at this point.

CarlosNZ commented 1 week ago

Re-opening this as found case where server actions are failing due to inappropriate characters -- need to investigate further