Skip to main content
Participant
March 6, 2020
Question

writeToBrowser not working in virtual host

  • March 6, 2020
  • 1 reply
  • 290 views

Hi dev, I'm using CF2018. Here I've tried to use writeToBrowser action in cfimage tag. It's working fine while run via webroot but it's not working ( Image disaplyed as blank in browser ) while I'm using virtual host. But both are having same code and running places or differnent.

 

Here is my sample code:

<cfimage action="read" source="C:\ColdFusion2018\cfusion\wwwroot\download.jpg" name="google" >

<cfimage action="writeToBrowser" width='200' heigth='200' source="#google#" />

Note : I did  console on image on the browser my test application & my virtual host application have same value in img tag like below.

<img src="/CFFileServlet/_cf_image/_cfimg-5097624825542879602.PNG" heigth="200" width="200" alt="">
<img src="/CFFileServlet/_cf_image/_cfimg2796608237126268946.PNG" heigth="200" width="200" alt="">

 

But webroot show the image virtual host not showing the image in browser.

    This topic has been closed for replies.

    1 reply

    Community Expert
    March 6, 2020

    There are all kinds of things that can break these "fake" file paths. You might find this helpful:

     

    https://www.bennadel.com/blog/1868-url-rewriting-and-coldfusions-writetobrowser-image-functionality-cffileservlet.htm

     

    Dave Watts, Eidolon LLC

    Dave Watts, Eidolon LLC