JS on the Web using XMLHTTP implementation download

xiaoxiao2021-03-06  110

Function Downurl (StrRemoteurl, Strlocalurl)

{

Try

{

VAR XMLHTTP = New ActiveXObject ("Microsoft.xmlhttp");

XMLHTTP.Open ("Get", StrremoteURL, FALSE);

Xmlhttp.send ();

VAR AdodbStream = New ActiveXObject ("AdoDb.Stream");

AdoDBStream.Type = 1; // 1 = adtypebinary

AdoDBStream.open ();

AdoDBStream.write (XMLHTTP.RESPONSEBODY);

AdodbStream.savetofile (StrlocalURL, 2);

Adodbstream.close ();

Adodbstream = NULL;

XMLHTTP = NULL;

}

Catch (e)

{

WINDOW.CONFIRM ("Download URL Error!");

}

//Window.confirm ("Download is complete.");

}

转载请注明原文地址:https://www.9cbs.com/read-125755.html

New Post(0)