Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 1245

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Using External Resources
Code
The CGI variable is: #CGI.mycgi# <br>
The Form variable is: #Form.emailaddress#. <br>
The file was uploaded to
#File.ServerDirectory#\#File.ServerFile#.
</cfoutput>
Return results of a CGI program
The following code runs a CGI program search.exe on a website and displays the results, including both the MIME
type and length of the response. The search.exe program must expect a "search" parameter.
<cfhttp method="Post"
url="http://www.my_favorite_site.com/search.exe"
resolveurl="Yes">
<cfhttpparam type="Formfield"
name="search"
value="ColdFusion">
</cfhttp>
<cfoutput>
Response Mime Type: #cfhttp.MimeType#<br>
Response Length: #len(cfhttp.filecontent)# <br>
Response Content: <br>
#htmlcodeformat(cfhttp.filecontent)#<br>
</cfoutput>
Performing file operations with cfftp
The
tag lets you perform tasks on remote servers using File Transfer Protocol (FTP). You can use
cfftp
connections for batch file transfers when uploading or downloading files.
Note: To use
, select the Enable ColdFusion Security option on the Sandbox Security page in the Security area in
cfftp
the ColdFusion Administrator. (In the Standard Edition, select Security > Basic Security.)
For server/browser operations, use the cffile, cfcontent, and cfdirectory tags.
Using
involves two major types of operations: connecting, and transferring files. The FTP protocol also provides
cfftp
commands for listing directories and performing other operations. For a complete list of attributes that support FTP
operations and additional details on using the cfftp tag, see the CFML Reference.
Open an FTP connection and retrieve a file listing
Create a ColdFusion page with the following content:
1
Description
Output the value of the CGI variable sent in the HTTP request.
Output the Form variable sent in the HTTP request. You send the
variable using the
page gets it as a Form variable.
Output the results of the
variables really are File variables.
Last updated 1/20/2012
attribute but the receiving
type="formField"
cffile
tag on this page. This time, the
cfftp
1240
to cache

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents