AnsweredAssumed Answered

Can't substitute \ in URL

Question asked by ndveitch on May 10, 2018
Latest reply on May 10, 2018 by User26648

Hi all,

 

Can someone please explain to me why the substitute() wont remove \ if there are 2 of them, \\. I have tried a number of different combinations, but I just cant seem to get the second \ to go away. I have a URL that I get from a JSON object, and I see when the data comes from the JSON object there is the second \ added, and im not to sure how to get rid of it .

 

The URL I am trying to view in the webviewer looks like this,

http:\\/\\/testdev.co.za\\/to\\/wp-content\\/uploads\\/gravity_forms\\/1-d30a9aff1aff5d0fb19114dcdf2f4b03\\/2018\\/05\\/Invoice-INV76160.pdf

 

I have tried;

Substitute ( InvHead::ImageLink ; [ "\"" ; "" ] ; [ "\/" ; "/" ]; [ "\"\"/" ; "/" ] )

Substitute ( InvHead::ImageLink ; [ "\"" ; "" ] ;  [ "\"\"" ; "" ] )

Substitute ( InvHead::ImageLink ; [ "\"" ; "|" ] ;  [ "\"\"" ; "|" ] )

Substitute ( GetAsURLEncoded ( InvHead::ImageLink ) ; [ "%5C" ; "" ] ; [ "%2F" ; "/" ] ; [ "%5B" ; "" ] ; [ "%22" ; "" ] ; [ "%2C" ; ¶ ] ; [ "%5D" ; "" ] )

 

The last one was something I found on the community about maybe using GetAsURLEncoded, but I saw that it brought up the extra % values. The last one I have gotten to work, but I see that there is a delay in opening up the PDF in the webviewer. Also because my knowledge is limited with URL encoding, Im not sure if the last one, which works, will bite me somewhere down the road.

Outcomes