[SalesForce] Access the file which is inside the .zip and inside the folder in which name the spaces are present in lightning

How could I access the image which is inside the .zip and inside the folder in which name the spaces are present in lightning?

For example, I have no problems accessing the following static resource:

$Resource.tF + '/f1/f2/testImg.png'

But I really can not access

$Resource.tF + '/f1/f 2/testImg.png'

Even when I try:

$Resource.tF + '/f1/f_2/testImg.png'

I was able to find nothing about the naming conventions in the case the only solution seems to be is to name the folders inside the .zip without any spaces.

Best Answer

I had the same experience lately, So I avoid using spaces in my asset names when I upload them to static resources. Nothing I have tried has worked, so my suggestions is to simply avoid spaces (as you are already doing) since not even an encoded space value works when trying to referencce them.

Does not work:

 <img src="{!$Resource.atst + '/tstAsst/live site.svg'}"/>
 <img src="{!$Resource.atst + '/tstAsst/live_site.svg'}"/>
 <img src="{!$Resource.atst + '/tstAsst/live%20site.svg'}"/>

live site.svg should be named live_site.svg OR liveSite.svg to avoid this issue.