What is this mean

<cfhttp method="get" url="http://localhost:8500/projects/test.txt" timeout="5" />
   <cfset header = cfhttp.header />
    <cfif listContainsNoCase(header, "200 OK")>
        <cflocation url="http://localhost:8500/projects/test.txt">
    <cfelse>
        <cfset request.proginfo.pagemessage="The  file   was not found.">
        <cflocation url="search.cfm">
    </cfif>
hi the above is bit confusing i am relocating to search.cfm instead of opening url in cfhttp , but the file still exists on the same path and i am able to open it up with address  http://localhost:8500/projects/test.txt
any one had idea  about what it is doing?
Thanks

Do this:
<cfhttp method="get" url="http://localhost:8500/projects/test.txt" timeout="5" />
<cfdump var=”# cfhttp#”>
That will display what returns from the cfhttp request. If that is not ‘200 OK’, if that is something else like 404, then your coldfusion server could not access localhost:8500. That happens base on the security settings in the web server. Try with the sever name or with the IP address. Some times that works.
If your test.txt and this cfm file in the server, you can use FileExists() function to check if the text file exists. That is way faster than cfhttp.
Thanks
Sam
cflove.org

Similar Messages

Maybe you are looking for