Create a text file online problem

Hello, i have an activex script that runs perfectly on my machine locally. Basically it creates a text file on the users machine (specifically the C drive)

function WriteToFile()
{
Try
{
var fso, s;
fso = new ActiveXObject("Scripting.FileSystemObject");
s = fso.CreateTextFile("C:\\philtech.html", true);
s.writeline('Success');
s.Close();
}
catch(err)
{
var strErr = 'Error:';
strErr += '\nNumber:' + err.number;
strErr += '\nDescription:' + err.description;
document.write(strErr);
}
}

Its more complicated than that but basically the user presses a button and executes that javascript and creates the file on the C drive.

As i have said, it works fine locally. But when i tried to upload this to geocities it fails. I also tried to access the file from a network machine and it gives the same error. I need to host this file on MY machine and have remote users create the files on their local drive.

Is there anything im missing here? any help would be appreciated :D
[1146 byte] By [ax2x3m] at [2007-11-19 22:55:28]
# 1 Re: Create a text file online problem
Online hosting is going to block ActiveX unless you change your security settings. Most people will not do this due to security holes that this will cause.
PeejAvery at 2007-11-8 0:40:27 >
# 2 Re: Create a text file online problem
for what purpose do you write a text file via activex onto the clients harddrive?

think about using cookies to store data on the users machine. No activex involded, sure the user has to allow cookies, but with the activex method you loose the battle much earlier. well and another great benefit of the cookie method: works also on non-windows machines :)

var sMyCookieName = 'blablabla';
var aCookies= document.cookie;
var iIndex = aCookies.indexOf(sMyCookieName);

if( iIndex == -1 ) {
// cookie not there
// create new one

// create an expiration date
var tExpire = new Date();
tExpire.setTime(tExpire.getTime() + [lifetime in seconds])

var sNewCookie = sMyCookieName + "=thedata(url encoded)":
sNewCookie += "; expires=" + tExpire.toGMTString();
sNewCookie += "; path=/";

document.cookie = sNewCookie;
} else {
// cookie is present.. do something

var sCookie = aCookies[iIndex];

// ......
}
bigBA at 2007-11-8 0:41:27 >
# 3 Re: Create a text file online problem
Nice thinking bigBA.

Also, ax2x3m, remember that ActiveX only runs in Internet Explorer. All other browsers will not recognize it.
PeejAvery at 2007-11-8 0:42:20 >
# 4 Re: Create a text file online problem
cookie idea is cool, though i really need activex for its file abilities. What im making is sort of an online or network signiture maker for my company that they can use with outlook

so i need to generate a text file or in my case an html file that they can use as a temoplate (with their user info based on the form a made)

any other was i can accomplish this without activex?
ax2x3m at 2007-11-8 0:43:25 >
# 5 Re: Create a text file online problem
Well, if you want to run on the local computer, then you are very limited and you can only use IE.

What you really need is to go to a server-side language such as PHP and use MySQL.

If you want to stick with IE, use VBScript.
PeejAvery at 2007-11-8 0:44:30 >
# 6 Re: Create a text file online problem
well, what about submitting the users data to a script which in turn returns a file for download? so the user itself can choose where to save the file to and it will also work for all browsers/OSs...
bigBA at 2007-11-8 0:45:26 >