# Image absolute path

#1

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.

#2

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.

#3

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

#4

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)

#5

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.

#6

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…

#7

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

#8

Yes, I’ve opened a bug report : https://github.com/jean-emmanuel/open-stage-control/issues/515

#9

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.