How to deal with case sensitive extensions ??

Post Reply
Arthur
Member
Posts: 113
Joined: Sat Sep 09, 2017 11:58 pm
Location: Yateley, UK

How to deal with case sensitive extensions ??

Post 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 ??
flussidicaio
Member
Posts: 21
Joined: Thu May 03, 2018 6:07 pm

Re: How to deal with case sensitive extensions ??

Post by flussidicaio »

Hi Arthur
You can put at the start of the flow a rename element (WITHOUT storing OriginalName) that change extension in ".pdf"
sander
Advanced member
Posts: 274
Joined: Wed Oct 01, 2014 8:58 am
Location: The Netherlands

Re: How to deal with case sensitive extensions ??

Post 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.
Arthur
Member
Posts: 113
Joined: Sat Sep 09, 2017 11:58 pm
Location: Yateley, UK

Re: How to deal with case sensitive extensions ??

Post 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.
Post Reply