Jump to content

Adodb.stream And Network Path


MurDoGG
 Share

Recommended Posts

Hi folkz,i'm using following code to download files in a javascript script:

	try 	{		if (XMLHttpRequest.readyState == 4) 		{			var fileName = XMLHttpRequest.responseText;						fileName = fileName.substring(6, fileName.length - 2);									if (fileName != null && fileName != "") {				var fsr = new ActiveXObject("ADODB.Stream");				fsr.Type = 1;				fsr.Open;				fsr.LoadFromFile(fileName);				var fsw = new ActiveXObject("ADODB.Stream");				fsw.Type = 1;				fsw.Open;				fsw.Write(fsr.Read);				fsw.SaveToFile(newFileName);				fsw.Close;			}		}	} catch(e) {		System.Debug.outputString(e);	}

Everything works fine, if i'am on my local system, so i can read files from my hard drive.What isn't possible apperntly, load files from a netowrk path, like \\server\path\file.ext, or i don't know how :)Following error information are availible:Errordescription: "'$lineinfo' ist undefiniert"Errormessage: "'$lineinfo' ist undefiniert"Errorname: TypeErrorErrornumber: -2146823279Someone have i idea where the fault is or what i have to do to read files from network path. If i should specify the filetype, i want to load zip files (don't know this is a relevant information).Kind regardsMurDoGG

Link to comment
Share on other sites

You're not calling the functions correctly, in Javascript you need parentheses after the function names. e.g.:fsr.Open();
Sorry my fault, i think it is JScript, not JavaScript. The source works, no problem with local path like C:\somefile.ext the problem isto access a network path like:

\\10.0.0.1\folder\file.ext

Link to comment
Share on other sites

JScript is Microsoft's implementation of Javascript, the same rules apply. Change the calls for the open and close methods and see if that makes a difference.
Mens, i don't write my post for trash, i wrote already, that its okay in the JScript implementation, to forget the "()". It WORKS. Please only write comments, if you understand the problem and have a solution. Time is money, perhaps you know.
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...