Solved

Creating FileSystemObject in Javascript [ Client Side ]

Posted on 2002-07-11
20
4,483 Views
Last Modified: 2007-11-27
I want to store some XML files in the Client machine in a specified folder.

For this i want to use the FileSystemObject in the Javascript.

When i create the object, it gives
"Automation Server can't create object"

Someone help me in this.

Thanks in advance
0
Comment
Question by:Bhaskar Ganapathe
  • 6
  • 5
  • 5
  • +3
20 Comments
 

Expert Comment

by:shuji
Comment Utility
I think the answer you are going to find is that you cannot access a client's file system (thank goodness) with Javascript - although there is a file system object for server-side Javascript, there is no such thing for client-side Javascript.



0
 
LVL 3

Accepted Solution

by:
tejaspurani earned 50 total points
Comment Utility
IE Specific.
For netscape need activex plugin
T.P.
<html>
<head>
<title>Javascript split function</title>
<SCRIPT LANGUAGE="JavaScript">
<!--

function driveexists(){
var fso = new ActiveXObject("Scripting.FileSystemObject");
hasDriveBool = fso.DriveExists("c");
alert(hasDriveBool);
}

function fileexists(){
var fso = new ActiveXObject("Scripting.FileSystemObject");
fileBool = fso.FileExists("d:\\old.txt");
}

function folderexists(){
var fso = new ActiveXObject("Scripting.FileSystemObject");
folderBool = fso.FolderExists("d:\\old");
}
function opentextfile(){
var ForWriting = 2;
var TriStateFalse = 0;
var fso = new ActiveXObject("Scripting.FileSystemObject");
var newFile = fso.OpenTextFile("f:\\test\\js\\tips\\001122.html", ForWriting, true, TriStateFalse);
}


-->
</SCRIPT>

</head>
<body onload="driveexists()">
</body>
</html>
0
 
LVL 5

Author Comment

by:Bhaskar Ganapathe
Comment Utility
Hi teja,

   I tried with you code. But it still gives Automation Server can't create object.

  I am using IE 5.5.

  Any other methods ?
 
  Important : This should work in client side

Thanks in advance
Bhaskar

0
 
LVL 3

Expert Comment

by:tejaspurani
Comment Utility
It works fine with IE
may be something  wrong with u r browser security.
just make it low, and execute the script u will get
an activex control popup just his yes.

Let me try to tesy on IE 5.5

T.P.
0
 
LVL 3

Expert Comment

by:tejaspurani
Comment Utility
post u r code.
T.P.
0
 
LVL 5

Author Comment

by:Bhaskar Ganapathe
Comment Utility
I have anyway done in the other method. Thanks for the efforts that you ppl. have taken for me.

If you are eager to know about what method i followed, let me know.

Bhaski
0
 
LVL 3

Expert Comment

by:tejaspurani
Comment Utility
ya sure let me know what else u have used.

T.P.
0
 
LVL 3

Expert Comment

by:tejaspurani
Comment Utility
waiting.....
T.P.
0
 
LVL 12

Expert Comment

by:ahosang
Comment Utility
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

PAQ
Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
ahosang
EE Cleanup Volunteer
0
Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

 
LVL 5

Author Comment

by:Bhaskar Ganapathe
Comment Utility
Hi People,

Sorry for not posting anything here, i was not able to access net for a while...
pl.s don't clean up this question, i will post my answers shortly,

bhaspup
0
 

Expert Comment

by:modulo
Comment Utility
Still open ?

modulo

Community Support Moderator
Experts Exchange
0
 
LVL 75

Expert Comment

by:Michel Plungjan
Comment Utility
Still open it seems
0
 
LVL 5

Author Comment

by:Bhaskar Ganapathe
Comment Utility
Hi guys,

Again sorry for not posting anything here, I used browsers caching facility to first cache my XML files.

First time it takes a long but considerable time to load. But once loaded, the rest of execution time is very fast.

Anyway thanks for your help in this regards,
bhaski
0
 
LVL 75

Expert Comment

by:Michel Plungjan
Comment Utility
Please finalize this
0
 
LVL 75

Expert Comment

by:Michel Plungjan
Comment Utility
A C-Grade is not acceptable. You can ask community support to change the grade or request a Paq and refund
0
 
LVL 5

Author Comment

by:Bhaskar Ganapathe
Comment Utility
If C-Grade is not acceptable, then why that grade is availbale for selection. ?
is that your request or its a rule that C-Grade should not be given ?
bhaski

0
 
LVL 75

Expert Comment

by:Michel Plungjan
Comment Utility
Not a RULE, but unfair if all you wanted was to get rid of the question.

http://www.cityofangels.com/Experts/Closing.htm#7
0
 
LVL 5

Author Comment

by:Bhaskar Ganapathe
Comment Utility
Ok, as per ur suggestion, herewith i request the Community support to change the grade to B. Else pls delete this question. I tried and failed seaching how to delete this question.

Thanks to mplungjan for giving me some clues about the activities in EE. I am not a regular user previously but now i'm trying to keep in touch with EE.

Thanks for your support.

Bhaski
0
 
LVL 75

Expert Comment

by:Michel Plungjan
Comment Utility
You cannot delete a question that has comments,  Coomunity support (link in left menu) can delete or change grades. I will post for you

Michel
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Today I would like to talk about localizing (Internationalization) JavaScript applications. Introduction When creating an application that is going to be used by many people around the globe, it is important to remember that not everyone speak…
Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now