Skip to main content
Participant
Mar 6, 2020 1:57 PM UTC
Question

writeToBrowser not working in virtual host

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 is closed to new replies. Start a new post to keep the conversation going.

    1 reply

    Community Expert
    Mar 6, 2020 6:56 PM UTC

    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

    Translate
    Dave Watts, Eidolon LLC