Adobe 38040334 API Reference - Page 23
MMHttp.getFileCallback, Returns, Example, Description, Arguments
UPC - 883919090467
View all Adobe 38040334 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 23 highlights
DREAMWEAVER CS3 18 API Reference 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: • 1: Unspecified error • 2: File not found • 3: Invalid path • 4: Number of open files limit reached • 5: Access denied • 6: Invalid file handle • 7: Cannot remove current working folder • 8: No more folder entries • 9: Error setting file pointer • 10: Hardware error • 11: Sharing violation • 12: Lock violation • 13: Disk full • 14: End of file reached 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 (Boolean == 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}