Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help with FTP link in Javascript

Status
Not open for further replies.

dadougalee

Programmer
Jul 29, 2005
10
US
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!
 
>I am trying to use "FileSystemsObject" to be able to open up a certain webpage that is on a FTP server...but it errors in the Javascript telling me it can't find the file I am looking for.
It is unfortunately because fso does not support ftp: protocol, period.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top