Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
|
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old April 29th, 2004, 11:13 PM
Authorized User
 
Join Date: Apr 2004
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to pigtail Send a message via Yahoo to pigtail
Default how to write output to an external file

I am having problem writing to an external file. I am getting Automation server can't create object error. Can you help? I got the same error even if I ran it from the webserver itself, writing to a shared folder.

<html>
<head>
<script language="JavaScript">
function A()
{
var fso, f1
  var ForReading = 1
  fso = new ActiveXObject("Scripting.FileSystemObject")
  f1 = fso.CreateTextFile("e:\\users\rtsui\testfile.txt", true)
  f1.WriteLine(" 1 or 2 or 3 etc ")
  f1.Close()
}
</script>
</head>
<BODY>
<A name="Client Number" value="1" onClick="A();">Client 1 FIND</A>
<A name="Client Number" value="2" onClick="A();">Client 2 FIND</A>
<A name="Client Number" value="3" onClick="A();">Client 3 FIND</A>
</BODY>
</html>


 
Old April 30th, 2004, 02:08 AM
Friend of Wrox
 
Join Date: Jul 2003
Posts: 683
Thanks: 0
Thanked 1 Time in 1 Post
Default

Hi pigtail,

The reason you are getting this message is that by default IE does not allow the creation of ActiveX objects that could be used maliciously on a clients machine.

People running your script would have to trust you enough to allow you to use these objects for your script to run, they would also have to use IE.

If you really want to do this, in IE go to Tools > Internet Options > Security > Custom Level & set the option "Initialize & Script ActiveX controls not marked as safe" to either enable (very dangerous) or prompt.

HTH,

Chris

 
Old April 30th, 2004, 09:34 AM
Authorized User
 
Join Date: Apr 2004
Posts: 31
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to pigtail Send a message via Yahoo to pigtail
Default

Thank you! It worked!






Similar Threads
Thread Thread Starter Forum Replies Last Post
How to write T-SQL to retrieve the required Output anilkumar.dwivedi SQL Language 3 June 26th, 2008 12:37 AM
not able to write check box output into table knight Classic ASP Databases 5 June 7th, 2004 11:40 PM
How to output Response.write to certain location alyeng2000 ASP.NET 1.0 and 1.1 Basics 3 December 9th, 2003 10:03 AM
How to write output for both search and post arg mqnguyen Classic ASP Basics 2 July 29th, 2003 03:11 PM
how to index output data using Response.write mqnguyen Classic ASP Basics 2 July 15th, 2003 11:49 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.