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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems with client-side FileSystemObject

Status
Not open for further replies.

MarcusH

Programmer
May 3, 2001
22
GB
Hi,

I'm trying to use the client-side javascript code below in order to get the size of a file on the client machine, but it keeps coming up with
'Automation server can't create object'.

It fails on the 'fso = new ActiveXObject("Scripting.FileSystemObject");' line.

<script language=&quot;javascript&quot;>
function(filespec){
var fso, f, s;
fso = new ActiveXObject(&quot;Scripting.FileSystemObject&quot;);
f = fso.GetFolder(filespec);
s = f.Name + &quot; uses &quot; + f.size + &quot; bytes.&quot;;
alert(s);
}
</script>

Any help on this would be much appreciaited.
Marcus
 
Hi,

I should have given my function a name. Just an error when I typed it into the forum. This is not the problem.

Marcus
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top