MACROMEDIA COLDFUSION MX 61-DEVELOPING COLDFUSION MX Develop Manual page 814

Developing coldfusion mx applications
Table of Contents

Advertisement

Replace C:\temp\ with an appropriate directory path on your hard drive.
2
Save the file as post_test_server.cfm in the myapps directory under your web_root.
3
View post_test.cfm in your browser and look for the file in C:\temp\ (or your replacement
4
path).
Reviewing the code
The following table describes the code and its function:
Code
<cffile destination="C:\temp\"
nameconflict="Overwrite"
filefield="Form.myfile"
action="Upload"
attributes="Normal">
<cfoutput>
The URL variable is: #URL.myurl# <br>
The Cookie variable is:
#Cookie.mycookie# <br>
The CGI variable is: #CGI.mycgi# <br>
The Form variable is:
#Form.emailaddress#. <br>
The file was uploaded to
#File.ServerDirectory#\#File.
ServerFile#.
</cfoutput>
To 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="Macromedia ColdFusion">
</cfhttp>
<cfoutput>
Response Mime Type: #cfhttp.MimeType#<br>
Response Length: #len(cfhttp.filecontent)# <br>
Response Content: <br>
#htmlcodeformat(cfhttp.filecontent)#<br>
</cfoutput>
814
Chapter 36: Interacting with Remote Servers
Description
Write the transferred document to a file on the server.
You send the file using the
attribute, but the receiving page gets it as
type="File"
a Form variable, not a File variable. This
creates File variables, as follows.
Output information. The results are not displayed by
this page. They are passed back to the posting page in
its
cfhttp.filecontent
Output the value of the URL variable sent in the HTTP
request.
Output the value of the Cookie variable sent in the
HTTP request.
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
attribute but the receiving page gets it as a Form
variable.
Output the results of the
time, the variables really are File variables.
cfhttpparam
cffile
variable.
type="formField"
tag on this page. This
cffile
tag

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the COLDFUSION MX 61-DEVELOPING COLDFUSION MX and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Coldfusion mx

Table of Contents