MACROMEDIA DREAMWEAVER 8-DREAMWEAVER API Reference page 33

Dreamweaver api reference
Table of Contents

Advertisement

Example
The following code gets an HTML file, saves all the files in the Configuration/Temp folder,
and then opens the local copy of the HTML file in a browser:
var httpReply = MMHttp.getFile("http://www.dreamcentral.com/¬
people/profiles/scott.html",
false);
if (httpReply.statusCode == 200){
var saveLoc = httpReply.data;
dw.browseDocument(saveLoc);
}
MMHttp.getFileCallback()
Description
This function gets the file at the specified URL, saves it in the Configuration/Temp folder
inside the Dreamweaver application folder, and then calls the specified function with the
request ID and reply result. When saving the file locally, Dreamweaver automatically creates
subfolders that mimic the folder structure of the server; for example, if the specified file is at
www.dreamcentral.com/people/index.html, Dreamweaver stores the index.html file in the
People folder inside the www.dreamcentral.com folder.
Arguments
callbackFunction, URL, {prompt}, {saveURL}, {titleBarLabel}
The
callbackFunction
HTTP request is complete.
The
argument is an absolute URL on a web server; if http:// is omitted from the
URL
URL, Dreamweaver assumes HTTP protocol.
The
argument, which is optional, is a Boolean value that specifies whether to
prompt
prompt the user to save the file. If
Configuration/Temp folder, a
The
argument, which is optional, is the location on the user's hard disk where
saveURL
the file should be saved, which is expressed as a file:// URL. If prompt is a
is outside the Configuration/Temp folder, the user can override
saveURL
Save dialog box.
The
titleBarLabel
title bar of the Save dialog box.
argument is the name of the JavaScript function to call when the
saveURL
value of
prompt
argument, which is optional, is the label that should appear in the
argument specifies a location outside the
is ignored for security reasons.
false
value or
true
in the
saveURL
The HTTP API
33

Hide quick links:

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the DREAMWEAVER 8-DREAMWEAVER API and is the answer not in the manual?

Subscribe to Our Youtube Channel

This manual is also suitable for:

Dreamweaver 8

Table of Contents