Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Coldfusion Report

Status
Not open for further replies.

GCM06

Programmer
Mar 21, 2006
10
0
0
CA
I have created a report in coldfusion and will like to know if this report can be send to an ftp site. I heard that this could be possible through scheduling. Is this correct?

Thanks in advance,
GC
 
check out the CFFTP for transferring files between CF servers and FTP servers.
 
Yes, you can use scheduler for that. I probably have hundreds of these running, though not with FTP, although I do have some FTP processes scheduled for other things, just not reports. Anyway, it works great.

You will need to capture the report html and store it in a text file first, and I like to use a common customtag called <cf_bodycontent> for that. You wrap it around any output, and instead of printing the output, it captures it to a variable called request.bodycontent.

I'd do something like:

Code:
<cfquery>query goes here</cfquery>
<cf_bodycontent>
<cfoutput>report, tables, data, etc goes here</cfoutput>
</cf_bodycontent>
<cffile action="write" file="" output="#request.bodycontent#">
<cfftp connection="ftp" action="OPEN" server="" username="" password="">
<cfftp connection="ftp" action="CHANGEDIR" directory="">
<cfftp connection="ftp" action="PUTFILE" localfile="" remotefile="" transfermode="AUTO">
<cfftp connection="ftp" action="CLOSE">

Fill in the empty "" marks with value paths, etc, and then schedule it in cfide/administrator, and let 'er rip.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top