Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 1240

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

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Using External Resources
<html>
<head>
<title>Use Get Method</title>
</head>
<body>
<cfhttp
method = "Get"
url="http://www.adobe.com/software"
path="c:\temp"
file="adobe_software.htm">
</body>
</html>
(Optional) Replace the value of the
2
3
(Optional) Change the path from C:\temp to a path on your hard drive.
Save the page as save_webpage.cfm in the myapps directory under your web_root directory.
4
Go to the specified path and view the file that you specified in a text editor (using the values specified in step 1, the
5
path is C:\temp\macr_software.htm).
The saved file does not appear properly in your browser because the Get operation saves only the specified web page
HTML. It does not save the frame, image, or other files that the page could include.
Reviewing the code
The following table describes the code and its function:
Code
<cfhttp
method = "Get"
url="http://www.adobe.com/software"
path="c:\temp"
file="macr_software.htm">
Get a binary file and save it
1
Create a ColdFusion page with the following content:
<cfhttp
method="Get"
url="http://www.adobe.com/adobe/accessibility/images/spotlight.jpg"
path="c:\temp"
file="My_SavedBinary.jpg">
<cfoutput>
#cfhttp.MimeType#
</cfoutput>
(Optional) Replace the value of the
2
3
(Optional) Change the path from C:\temp to a path on your hard drive.
Save the file as save_binary.cfm in the myapps directory under your web_root and open it in the web browser to
4
view the MIME type.
(Optional) Verify that the binary file now exists at the location you specified in the
5
attribute with another URL and change the filename.
url
Description
Get the page specified in the URL and save it in the file specified by the
attributes.
file
When you use the
path
attribute. As a result, frames and other included files cannot appear
resolveurl
when you view the saved page.
attribute with the URL of a binary file that you want to download.
url
Last updated 1/20/2012
and
attributes, ColdFusion ignores any
file
attribute.
path
1235
and
path

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents