dadougalee
Programmer
I am trying to use "FileSystemsObject" to be able to open up a certain webpage that is on a FTP server. Now the file opens and displays the text and fonts in the body, but it errors in the Javascript telling me it can't find the file I am looking for. But I am certain it is there. Here is a section of my code:
function ShowExtensionName(filespec)
{
var fso, s = "";
fso = new ActiveXObject("Scripting.FileSystemObject");
s += fso.GetExtensionName(filespec);
return(s);
}
var fsObj = null;
var foldedToList = "ftp://rabbit:doug@192.168.70.44/plantFloor.html"
var xml = new ActiveXObject("Microsoft.XMLDOM")
xml.async = false
fsObj = new ActiveXObject('Scripting.FileSystemObject');
if (!fsObj)
{
alert('You must allow the ActiveX object to run!');
}
else
{
if (!fsObj.FolderExists(foldedToList))
{
alert('The folder:\n\n' + foldedToList + '\n\ndoes not exist!');
}
else
{
var folderObj = fsObj.GetFolder(foldedToList);
var filesObj = new Enumerator(folderObj.files);
filesStr = '';
var counter = '0'
while (!filesObj.atEnd())
{
var tempFile = filesObj.item();
var ext = ShowExtensionName(tempFile);
if(ext == 'xml')
{
xml.load(tempFile.Name)
...
Thanks for any help!
function ShowExtensionName(filespec)
{
var fso, s = "";
fso = new ActiveXObject("Scripting.FileSystemObject");
s += fso.GetExtensionName(filespec);
return(s);
}
var fsObj = null;
var foldedToList = "ftp://rabbit:doug@192.168.70.44/plantFloor.html"
var xml = new ActiveXObject("Microsoft.XMLDOM")
xml.async = false
fsObj = new ActiveXObject('Scripting.FileSystemObject');
if (!fsObj)
{
alert('You must allow the ActiveX object to run!');
}
else
{
if (!fsObj.FolderExists(foldedToList))
{
alert('The folder:\n\n' + foldedToList + '\n\ndoes not exist!');
}
else
{
var folderObj = fsObj.GetFolder(foldedToList);
var filesObj = new Enumerator(folderObj.files);
filesStr = '';
var counter = '0'
while (!filesObj.atEnd())
{
var tempFile = filesObj.item();
var ext = ShowExtensionName(tempFile);
if(ext == 'xml')
{
xml.load(tempFile.Name)
...
Thanks for any help!