Question
· Dec 6, 2021

EnsLib.File.PassthroughService replaces spaces with underscores in file names.

EnsLib.File.PassthroughService replaces spaces with underscores in filenames.

Example:

File name of GWUH_9999_GWUHMRN_9999_99999_Chart Note_999999.pdf lands in receiving folder as GWUH_9999_GWUHMRN_9999_99999_Chart_Note_999999.pdf.

The same behavior is occurring when the file is saved to the archive folder.

Has anyone encountered this issue and devised a fix or workaround?

Product version: IRIS 2020.1
$ZV: IRIS for Windows (x86-64) 2020.1 (Build 215U) Mon Mar 30 2020 20:14:33 EDT [HealthConnect:2.1.0]
Discussion (1)0
Log in or sign up to continue

This is mentioned here in docs here: https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY...

From what I can tell this occurs in the operation rather than the service (so if doing something in a process it would still have spaces) and though sort of implies that this occurs when using format codes like %f it will do this even if you specified an exact name like "Chart Note.pdf". There's no control over it that I can tell as an unconditional $TR of occurs right away in Ens.Util.File:CreateTimestamp which is what ends up being executed during file/SFTP operations. You would need to use a custom EnsLib.File.PassthroughOperation with updates to the two Set tFilename calls in OnMessage to use your own version of CreateTimestamp. There is actually one call directly to that but the other goes to the EnsLib.File.OutboundAdapter's CreateFilename method which calls CreateTimestamp. So might also need a custom adapter, referred to by the PassthroughOperation, but can probably get around that if going to this much trouble!