473,797 Members | 3,152 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to create text file in javascript

11 New Member
Hi,

I would like to know if it is possible to use JavaScript to write to a text file. I tried using FileSystemObjec t in JavaScript. However, it gives the following error : "Automation server can't create object". Does anyone know what is going wrong here?



Expand|Select|Wrap|Line Numbers
  1. var fso = new ActiveXObject("Scripting.FileSystemObject");
  2. var s = fso.CreateTextFile("C:\test.txt", true);
  3. s.WriteLine("helloworld");
  4. s.Close(); 
  5.  
thanks
Oct 22 '07 #1
3 2391
acoder
16,027 Recognized Expert Moderator MVP
It will probably be caused by the security settings in your browser. You'll have to allow ActiveX objects/scripts to run. Note that you shouldn't use this setting for browsing the Internet.
Oct 22 '07 #2
Elavarasi
11 New Member
Thanks its working.. but when update the file into ftp.. whoever using that page
they have to set the security settings?????.. .

It will probably be caused by the security settings in your browser. You'll have to allow ActiveX objects/scripts to run. Note that you shouldn't use this setting for browsing the Internet.
Oct 22 '07 #3
acoder
16,027 Recognized Expert Moderator MVP
Thanks its working.. but when update the file into ftp.. whoever using that page
they have to set the security settings?????.. .
Well, it is creating a file on their system, so yes.

You'll probably have to include a message informing your users that this page will only work in IE with ActiveX enabled and remind them to revert back afterwards. In IE7, I think a bar appears at the top which allows the ActiveX to run for that page only.
Oct 22 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
2635
by: D. Lee Christopher | last post by:
Can anyone point me to a good tutorial for creating a site-level search applet? I am trying to create a virtual catalog of sorts, and I would like to be able to search the catalog and have the results displayed on the same page with one column text and an image of the product. I've seen several tutorials that create site-level searches that will bring back a search results page with options to choose from. I am looking to create a...
1
3833
by: Scott Navarre | last post by:
Hello, I have noticed that when using JavaScript to create a page, the sizes of the text input form elements come out bigger than the size I am trying to set them to. I don't know if it matters, but I am using IE6... For example: if I create a text input with a size of "1" using straight HTML, and then type into it, I can see 2 characters at a time. But when I use JavaScript's 'document.write()' function to create the same text...
7
1356
by: Peter Afonin | last post by:
Hello, This should be a simple question to anyone who knows JavaScript, but I'm new to it. I have a JavaScript that I need to use in many pages. How do I create JS includes? I tried the standard method - created a text file, then includud it like this:
7
7770
by: moondaddy | last post by:
I want to dynamically create a JavaScript file and cache it on the client for re-use. I know how to write javascript to a web page from the code behind, but I don't know how to actually create a file such as MyNewScript.js and then cache that on the client so all the pages of that session can use it. Can this be done? Thanks -- moondaddy@nospam.com
2
1856
by: SteMc | last post by:
Hi, I'm trying to create a text file on an asp page but am having loads of trouble. At the minute what happens is this - I have a form with a textarea. When the form posts, the action is to run an asp page. Inside the asp page I want to take the text from the textarea and write it to a text file. the following way to do this;
1
2042
by: sebastian.janoschka | last post by:
Hello javascript newsgroup, Sorry for my bad english please... Today I have write some of my first JS scripts. My problem is to create a <spantag in the div tag with the name "favoriten". In the first step I create the span tag in the "hinzufügen" function
7
2732
by: Danny | last post by:
Hello: I would like to develop a browser extension, or whatever such a thing is classified as, that would allow a user of IE6, and possibly IE7, to switch between a live and development page. I'm sure the individuals reading this are familiar with what I'm referring to; however, I'll provide an example.
4
8285
by: sirjohnofthewest | last post by:
If I possessed the power to sway the mind of every user in the world to delete all forms of Internet Explorer I would die a happy man. Hi guys, I frequently visit this site to get answers to my problems and this one is really getting to me... I have a page that allows you to Browse Authors. There are three drop down boxes that auto-populate via AJAX. I have a file which it calls and returns the dynamically built XML file in the boxes...
0
3740
by: TrevRex | last post by:
Hello, I work for a non-profit in San Diego as a GIS Specialist. I have had to teach myself about some scripting to create some dynamic maps, but I am still very limited in my skills, so I have had to explore the internet in order to discover various tutorials and examples that have led me on a positive path. Right now I am working on a Google Mash-Up that will incorporate over 14,000 records, which will appear as separate markers that...
0
9685
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9537
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10023
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9066
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6803
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5459
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4135
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3750
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2934
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.