Image absolute path


Trying to work out in which folder to put my images to load into an image widget. The docs say File url or absolute path. How do I use absolute path with o-s-c? I cant work out the directory structure. I checked with dev tools and its using my local IP as the base directory…could I use relative paths too? Where do I need to store my images? I’m on windows by the way. Thanks so much.


On windows an absolute path looks like C:\path\to\image.jpg, the directory structure is your system’s.

could I use relative paths too

No, only urls (http://etc…) or absolute file paths.


There seem to be an issue with windows absolute paths actually, I’ll look into it.


I tried this for a panel

>.panel{ background:url('C:\image.jpg'); }

and the panel turned gray but didn’t show the image…
on inspection, chrome showed me

background: url(http://192.68.etc.etc:8080/C:image.jpg)


background: url(http://192.68.etc.etc:8080/C:image.jpg)

The http:// part is expected, it’s supposed to be resolved on the server side. Now as I said there’s an issue with windows paths.


I’ve been giving this some thought and I’ll have to change this in next release: I think file paths should always be resolved relatively to the remote-root option introduced in v0.44.0 (which defaults to the user’s home directory).

Edit: kind of thinking out loud here, this might need some more tinkering before getting done right…


So at the moment, it’s not working correctly?


Yes, I’ve opened a bug report :


The bug is fixed in v0.45.5, as for always resolving path relatively to the remote-root I’ve chosen a softer approach that mitigates security risks while ensuring retro-compatibility: absolute path requests are now only allowed for images.