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="[email protected]"
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.
Summary of Contents for COLDFUSION 5-DEVELOPING
Page 1: ...Macromedia Incorporated Developing ColdFusion Applications MacroMedia ColdFusion 5 ...
Page 58: ...38 Chapter 3 Querying a Database ...
Page 134: ...114 Chapter 7 Updating Your Database ...
Page 210: ...190 Chapter 10 Reusing Code ...
Page 232: ...212 Chapter 11 Preventing and Handling Errors ...
Page 238: ...218 Chapter 12 Using the Application Framework ...
Page 262: ...242 Chapter 12 Using the Application Framework ...
Page 278: ...258 Chapter 13 Extending ColdFusion Pages with CFML Scripting ...
Page 320: ...300 Chapter 15 Indexing and Searching Data ...
Page 336: ...316 Chapter 16 Sending and Receiving E mail ...
Page 374: ...354 Chapter 18 Interacting with Remote Servers ...