MMHttp.getFile()

Description

This function gets the file at the specified URL and saves it in the Configuration/Temp folder, which is located in the Dreamweaver application folder. 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

URL, {prompt}, {saveURL}, {titleBarLabel}

Returns

An object that represents the reply from the server. The data property of this object is a string that contains the location where the file is saved, which is expressed as a file:// URL. Normally, the statusCode property of the object contains the status code that is received from the server. However, if a disk error occurs while Dreamweaver is saving the file on the local drive, the statusCode property contains an integer that represents one of the following error codes if the operation is not successful:

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);
}

 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/dreamweaver/8/apiref/03_http6.htm