/    Sign up×
Community /Pin to ProfileBookmark

Question about JSP’S FSO Function?

Below is a jsp I want to use in my web, but it does not work as expected.
The script can not generate a testfile.txt.
Do I need to set up anything with IE.

Does anyone can give me some ideas.
Thanks so much.
<html>
<Script>
var fso, tf;

fso = new ActiveXObject(“Scripting.FileSystemObject”);

tf = fso.CreateTextFile(“c:testfile.txt”, true);

tf.WriteLine(“Testing 1, 2, 3.”) ;

tf.WriteBlankLines(3) ;

tf.Write (“This is a test.”);

tf.Close();

</script>
</html>

to post a comment
JavaScript

4 Comments(s)

Copy linkTweet thisAlerts:
@GamineauthorJan 26.2009 — Is there anyone can help me?

Thanks so much
Copy linkTweet thisAlerts:
@voidvectorJan 26.2009 — That is not JSP, JSP is "Java Server Page". Java and JavaScript are totally different programming languages.

The code you presented is JavaScript. But you cannot use that on a public web page, because you are trying to access local file.
Copy linkTweet thisAlerts:
@GamineauthorJan 27.2009 — Thanks.

I just start learning.

I do not use the Javascript on a public web.

I only want to use it on my own computer and access my own harddriver.

Is there any other method which will allow my to write file through Javascript.

Thanks so much
Copy linkTweet thisAlerts:
@A1ien51Jan 27.2009 — Look at your browser's settings. You should be able to move that into your "trusted" pages and change the right's to allow the functionality to run.

Eric
×

Success!

Help @Gamine spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.10,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...