Images with Virtual File System

I’m trying to pull an image from the virtual file store and use it directly in a web page… I must be missing something because I just can’t get it to work…

I’ve set up the mapping in Application.cfc -

this.mappings["/ram"] = "ram://";

and I’m using an include to test that the mapping is working -

include "/ram/susi.txt";

Everything works. When I use the include for the image file there is data there only not an image, as expected…

include "/ram/printFiles/Minvoicelogo1.jpg";

However when I try
<cfoutput> <img src="/ram/printFiles/Minvoicelogo1.jpg"> </cfoutput>

Nothing happens and I get a broken link on the actual web page. I’m obviously not getting the ram part processed on the web page but Lucee is parsing the page and producing output. Do I need to convert the file at all?

Any thoughts?

TIA

Tony

Try this

https://trycf.com/gist/ac959131631dcf0ca93df80fb388e6e4/lucee5?theme=monokai

img = ImageRead('[https://avatars1.githubusercontent.com/u/10973141?s=280&v=4](https://avatars1.githubusercontent.com/u/10973141?s=280&v=4)')

Thanks - That sorted it…

Always used the filesystem rather than the ram system! I’ll use the ram more now…