Hamid,
    I have had problems using the query output in a loop (usally only when I
am doing a nested query, though) -- try setting it to a temp variable first
and see if that helps.
<cfloop query="IDs">
    <cfset tmpID = ids.CatID>
    <cfhttp method="GET"
 url="http://www.xyz.com/Cat.cfm?id=#tmpID#";
 resolveurl="Yes"></cfhttp>

You may also try putting a timeout on the cfhttp as well.


----- Original Message -----
From: "Hamid Hossain" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Sunday, May 20, 2001 9:43 AM
Subject: CFHTTP - loop problem


> Hi folks,
>
> I tried to make a loop of cfhttp requests to a url and
> save every CFHTTP.FileContent in a separated text
> file.
>
> The problem that I failed to run my code through a
> loop while it is running good when make one cfhttp
> request.
>
> the code that caused the problem:
> ===================== index.cfm =====================
> 01  <cfquery datasource="Datasource" name="IDs">
> 02      SELECT CatID FROM Cats
> 03  </cfquery>
> 04
> 05  <html><body>
> 06
> 07  <cfloop query="IDs">
> 08      <cfhttp method="GET"
> url="http://www.xyz.com/Cat.cfm?id=#IDs.CatID#";
> resolveurl="Yes"></cfhttp>
> 09      <cffile action="WRITE"
> file="D:\myWebRoot\ARCHIVES\#IDs.CatID#.cfm"
> output="#cfhttp.FileContent#">
> 10  </cfloop>
> 11  <p> I am Finished!
> 12  </body></html>
> =====================================================
>
> Lines 01-03: Reading from a database to get all IDs.
> Line 07: Starting a loop on IDs collected from the
> query.
> Line 08: CFHTTP request to a website with id of loop.
> Line 09: CFFILE save the cfhttp.FileContent into cfm
> file inside ARCHIVES directory.
>
> if you deleted the loop in the previous code, it will
> work successfully.
>
> I need it with a loop!!!
>
> any suggestion will be appreciated.
> Hamid Hossain
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to