User Guide
338 Chapter 18 Interacting with Remote Servers
</body>
</html>
3 Replace the path to the GIF file to a path on your server.
4 Save the file as posttest.cfm in
myapps under your Web root directory.
Reviewing the code
The following table describes the code and its function:
To view the variables:
1 Create a new file in ColdFusion Studio.
2 Modify the file so that it appears as follows:
<cffile destination="C:\temp\Junk"
nameconflict="Overwrite"
filefield="Form.myfile"
action="Upload"
attributes="Normal">
Code Description
<cfhttp method="Post"
url="http://127.0.0.1/myapps/
server.cfm">
Post an HTTP request to the specified
page.
<cfhttpparam type="Cookie"
value="cookiemonster"
name="mycookie6">
Send a cookie in the request.
<cfhttpparam type="CGI"
value="cgivar "
name="mycgi">
Send a CGI variable in the request.
<cfhttpparam type="URL"
value="theurl"
name="myurl">
Send a URL in the request.
<cfhttpparam type="Formfield"
value="wbfreuh@macromedia.com"
name="emailaddress">
Send a Form field in the request.
<cfhttpparam type="File"
name="myfile"
file="c:\testImage.gif">
</cfhttp>
Send a file in the request.
The
</cfhttp> tag ends the http request.
<cfoutput>
File Content:<br>
#cfhttp.filecontent#<br>
Display the contents of the file that the
page that is posted to creates by
processing the request. In this example,
this is the output from the
cfoutput tag in
server.cfm.
Mime Type: #cfhttp.MimeType#<br>
</cfoutput>
Display the MIME type of the created file.