268
Chapter 14 Scripting the Visual Tools Object Model
The following error messages are predefined. Check for the error strings to detect
these error cases:
•
File already exits—Returned when file specified in FilePath exists and
bOverwrite
is set to
False
.
•
Path does not exist—Returned when the path specified in
FilePath
does not
exist.
Example
Sample download script
//*******************************************//
// This script downloads a ZIP file using
// SaveReceivedStreamToFile
//*******************************************//
function Main () {
var hsOKInfo = 64;
var app = Application;
var httpPro = app.HTTPProvider;
httpPro.URL = "http://127.0.0.1/test.zip";
httpPro.Get();
var bOverwrite = false;
var sErrorMsg =
httpPro.SaveReceivedStreamToFile("d:\\downloads\\test.zip",
bOverwrite );
if ( sErrorMsg != "" )
{
app.MessageBox( "A error occured :" + sErrorMsg ,"HTTPProvider
Error", hsOKInfo);
}
}
URLEncode
Syntax
URLEncode(const wsValue: WideString): WideString;
Description
Returns a URLEncoded form of the wsValue string. Use this function when
populating URL or FORM data.
Содержание ColdFusion Server 5
Страница 18: ...xviii About This Book...
Страница 26: ...8 Chapter 1 Setting Up the Product...
Страница 42: ...24 Chapter 2 Configuring Browsers and Servers...
Страница 60: ...42 Chapter 3 Exploring the Workspace...
Страница 100: ...82 Chapter 6 Editing Pages...
Страница 126: ...108 Chapter 7 Using Web Development Languages...
Страница 212: ...194 Chapter 13 Customizing the Development Environment...
Страница 320: ...302 Glossary...