Using javascript, I am setting the src property of an image object
mainImage.src = filePath;
When filePath is something like C:\images\pink.jpg, I have no problems But I found a bug where the filename is of the type:
C:\images\uploads%2Fcard%2Fimage%2F1574322%2F0b0640a8-cfca-45fa-b1c7-2cfc9a97c146.jpg%2Ffull-fit-in__950x534.jpg
It seems that the %2F is read as a \ character and I end up with a net::ERR_FAILED error. But the filename is literally uploads%2Fcard%2Fimage%2F1574322%2F0b0640a8-cfca-45fa-b1c7-2cfc9a97c146.jpg%2Ffull-fit-in__950x534.jpg.
Is there a way to set the src property of an image with filenames such as these without any error? I am setting this value in an electron project which means that chrome is being used to test. Many Thanks