![MACROMEDIA COLDFUSION 4.5-DEVELOPING WEB Develop Manual Download Page 263](http://html1.mh-extra.com/html/macromedia/coldfusion-4-5-developing-web/coldfusion-4-5-developing-web_develop-manual_3286369263.webp)
Chapter 15: Interacting with Remote Servers
237
You have POSTed to me.<BR>
<CFFILE DESTINATION="c:\temp\junk"
NAMECONFLICT="Overwrite"
FILEFIELD="myfile"
ACTION="Upload"
ATTRIBUTES="Normal">
<CFOUTPUT>
The URL variable is: #url.myurl# <BR>
The Cookie variable is: #cookie.mycookie6# <BR>
The CGI variable is: #cgi.mycgi#. <BR>
The Formfield variable is: #form.myformfield#. <BR>
</CFOUTPUT>
3.
Replace
c:\temp\junk
with a path and filename on your hard drive.
4.
Save the file as
posttest.cfm
in
myapps
under your Web root directory.
This example uses the CFFILE tag to upload the contents of the file variable to
c:\temp\junk.
It passes the five supported variable types to the page specified in the URL attribute.
The page that receives this data is also shown. It returns the value of the variables
which appears in the client’s browser. This example uses the CFFILE tag in the page
that receives the Posted variables to upload the contents of the file variable to
c:\temp\junk.
The CFOUTPUT section in
posttest.cfm
references the
CFHTTP.FileContent
variable, which is used to display the output from the
server.cfm
file. If the
CFHTTP.FileContents
variable were left out, the browser output would be limited to
the contents of the
posttest.cfm
file.
To return resuls of a CGI program:
1.
Create a new file in Studio.
2.
Modify the file so that it appears as follows:
<CFHTTP METHOD="Post"
URL="http://www.thatsite.com/search.exe"
RESOLVEURL="Yes">
<CFHTTPPARAM TYPE="Formfield"
NAME="search"
VALUE="hello">
</CFHTTP>
<CFOUTPUT>
#CFHTTP.MimeType#<BR>
Length: #len(cfhttp.filecontent)# <BR>
Content: #htmlcodeformat(cfhttp.filecontent)#<BR>
</CFOUTPUT>
3.
Save the file as
getcgivars.cfm
in
myapps
under your Web root directory.
Summary of Contents for COLDFUSION 4.5-DEVELOPING WEB
Page 1: ...Allaire Corporation Developing Web Applications with ColdFusion ColdFusion 4 5...
Page 14: ...xiv Developing Web Applications with ColdFusion...
Page 26: ...xxvi Developing Web Applications with ColdFusion...
Page 34: ...8 Developing Web Applications with ColdFusion...
Page 70: ...44 Developing Web Applications with ColdFusion...
Page 84: ...58 Developing Web Applications with ColdFusion...
Page 114: ...88 Developing Web Applications with ColdFusion...
Page 148: ...122 Developing Web Applications with ColdFusion...
Page 174: ...148 Developing Web Applications with ColdFusion...
Page 208: ...182 Developing Web Applications with ColdFusion...
Page 244: ...218 Developing Web Applications with ColdFusion...
Page 274: ...248 Developing Web Applications with ColdFusion...
Page 288: ...262 Developing Web Applications with ColdFusion...
Page 300: ...274 Developing Web Applications with ColdFusion...
Page 350: ...324 Developing Web Applications with ColdFusion...
Page 362: ...336 Developing Web Applications with ColdFusion...