Hi, I’m trying to build a form in which a user can select a pdf file which will then be displayed in the form. I’m using an iframe in an HTML Element Component:
The src attribute of the iframe is defined as:
/file://localPathToTheFile
This does work as long as there are no spaces in the path to the pdf file, e.g.:
/file://c:\path\abc.pdf - works
/file://c:\path\a bc.pdf - does not work
I’ve tried to properly encode the URI with the encodeURI function, but this did not help. Does anyone know how to encode the src attribute of the iframe to allow spaces? Or is there a better approach to display pdf files in the form?
Here is the form I’ve implemented so far: Test.xaml (13.2 KB)
Not sure which escape character you are referring to. I’ve tried to replace the space with %20 but this did not work. Is UiPath using a special escape character to allow spaces in a file path?
I see. Hmm to be honest right now I’m not sure if we should consider it as a bug or I don’t know something. Let’s add @Tamilselvan here Hopefully he will help here.
I confirmed that when you try to get /file://c:\path\a bc.pdf, what it actually gets
is c:\path\a%20bc.pdf meaning that the space is URL encoded.
Because of this, I believe with the current design, adding space as part of the path is not possible.
I have raised this issue to the devs.