Page 1 of 1

How to deal with case sensitive extensions ??

Posted: Fri Jul 20, 2018 5:50 pm
by Arthur
I have just come across a situation where Switch showed that file extensions are case sensitive.
I have a rename element which stores OriginalName in PD, which then in turn is to be used for Assembling the job further down the line.
And it occured that *.PDF is not the same thing as *.pdf. Referencing PD OriginalName before ".pdf" gave an error, as the original FileName was with PDF (Capitals) extension.
It did not matter for how the file was handled inside switch, inclusive of third party elements / configurators etc.
Both options are valid 'pdf' files, but when naming comes into play - they are different.
How do I force Switch to see PDF and pdf as one and the same filetype ??
At the moment I worked round it by removing the extension and adding lowercase pdf, but this is bigger than only this case.
I believe this being an issue in Switch regardless of the filetype, that ie.: DOCX and docx are not the same and so on....

This is utterly stupid. What benefit of this differentiation ??

Re: How to deal with case sensitive extensions ??

Posted: Mon Jul 30, 2018 2:52 pm
by flussidicaio
Hi Arthur
You can put at the start of the flow a rename element (WITHOUT storing OriginalName) that change extension in ".pdf"

Re: How to deal with case sensitive extensions ??

Posted: Mon Jul 30, 2018 3:02 pm
by sander
I replace with this one, so one rename job does lower all extensions:
[Job.Extension:Case="lower"]
This is utterly stupid. What benefit of this differentiation ??
JavaScript is a case-sensitive language.

Re: How to deal with case sensitive extensions ??

Posted: Mon Jul 30, 2018 6:20 pm
by Arthur
This is what I also did - replace with lowercase pdf.
There seems to be nothing else that would sort it out, since it is more of a Java Script being case sensitive.