I have a utility application that displays PDF files in a revbrowser window. The name of the file is passed to the browser as a URL. If the name passed contains either a space or a pipe then the browser fails to locate the file and displays a blank page. The solution is to replace the special characters with their hex values using the lines below
Code: Select all
replace " " with "%20" in tMyFilePath
replace "|" with "%7C" in tMyFilePath
I had a look in the dictionary and read about the URLEncode command. This appears to remove the need for a list of special characters but unfortunately it does not seem to work. The example filename contains spaces and the pipe character:
Code: Select all
20160101 iphone 6s order John Lewis | Your receipt.pdf
Code: Select all
/Users/skids/Desktop/DocumentScans/3rdJan2017Scans/20160101%20iphone%206s%20order%20John%20Lewis%20%7C%20Your%20receipt.pdf
Code: Select all
%2FUsers%2Fskids%2FDesktop%2FDocumentScans%2F3rdJan2017Scans%2F20160101+iphone+6s+order+John+Lewis+%7C+Your+receipt.pdf
Thanks
SimonK