Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

"Permission denied" error message on new ActiveX object

Hi:

I'm trying to save a file to my hard drive from a URL with this great JavcaScript code I downloaded from this site. However, I get a "Permission denied" on Line 6, that is, when the new ActiveX object creation is attempted.

What could be wrong and how can it be fixed?

Thanks,
Roberto

-------- Start code --------



function SaveToDisk(sUrl, sPath)
{
var x = new ActiveXObject("Msxml2.XMLHTTP.3.0");
x.open("GET", sUrl, false);
x.send();
if (x.status == 200)
{
var fso = new ActiveXObject("Scripting.FileSystemObject");
var fileDest = fso.CreateTextFile(sPath, true, true);
if (fileDest)
{
fileDest.Write(x.responseText);
fileDest.close();
}
else
{
alert("unable to create file " + sPath);
}
}
else
{
alert("HTTP error status " + x.status + " from " + sUrl);
}

}





Sign In or Register to comment.