title: cfhttp to get an image and save to the disk
body: <p>I am trying to get an image from a url and save it to the local using cfhttp like below.</p>
  
  <pre><code>&lt;cfhttp
      timeout="45"
      throwonerror="false"
      url="http://domain/images/cme_recorder_on.png"
      method="get"
      useragent="Mozilla/5.0 (Windows; U; Windows NT 6.0; en-US; rv:1.8.1.12) Gecko/20080201 Firefox/2.0.0.12"
      getasbinary="yes"
      result="local.objGet"
  &gt;
  
  &lt;cfset myImage = ImageNew(local.objGet.FileContent)&gt;
  
  &lt;cfif (FindNoCase( "200", local.objGet.Statuscode ) AND FindNoCase( "image", local.objGet.Responseheader["Content-Type"]
          ))&gt;   
        &lt;cfoutput&gt;this is an image&lt;/cfoutput&gt;
         &lt;cffile file="#myImage#" action="write" output="c:\test_myImage.jpg"&gt; 
  &lt;cfelse&gt;
       &lt;cfabort&gt;   
  &lt;/cfif&gt;
  </code></pre>
  
  <p>I have tried using cffile write to save the image to the local. I do not see any image being writted into c:. Is this the right way to save the image to disk? Thanks all</p>