Greetings, I need a simple method using ActiveXobject in javascript to write a text file from the local drive to my webserver. I found a method on a previous thread that copies a file from the webserver to the local drive that works but I need to reverse this. The code I found previously on the posting from "drink.the.cool aid" is as follows.
_______________ _______________ __
Create a text file called c:\GetWebPage.j s:
>From a command line type:
cscript /nologo c:\GetWebPage.j s http://www.YOUR_URL_HERE.com c:
\YOUR_OUTPUT_FI LE_HERE.txt
_______________ _______________ _______
Is there a way to reverse this code to copy the file from the local to the webserver instead?
_______________ _______________ __
Create a text file called c:\GetWebPage.j s:
Code:
var fso = new ActiveXObject('Scripting.FileSystemObject');
var args = WScript.Arguments;
var url = args(0);
var fileName = args(1);
var xmlhttp=new ActiveXObject("microsoft.xmlhttp");
xmlhttp.open("GET", url, false);
xmlhttp.send();
var data=xmlhttp.responsetext;
var file = fso.CreateTextFile(fileName, 2);
file.writeLine(data);
file.close();
cscript /nologo c:\GetWebPage.j s http://www.YOUR_URL_HERE.com c:
\YOUR_OUTPUT_FI LE_HERE.txt
_______________ _______________ _______
Is there a way to reverse this code to copy the file from the local to the webserver instead?
Comment