473,412 Members | 1,944 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

can I write to a local .txt File wit javascribt?

javascript:
can I write to a local .txt File
as exaple:

open() ....writel(() ...close()..... ....save as ... c:\test.txt
thank you if you have an idea
Hansueli
Jul 20 '05 #1
5 9220
On Thu, 20 Nov 2003 18:46:56 +0100, Rickli Hansueli wrote:
javascript:
can I write to a local .txt File
as exaple:

open() ....writel(() ...close()..... ....save as ... c:\test.txt thank
you if you have an idea
Hansueli


You shouldn't be able to from what I know.
That would violate the browser security.
--
i.m.
The USA Patriot Act is the most unpatriotic act in American history.

Jul 20 '05 #2
"Rickli Hansueli" <ri****@rickli.com> writes:
javascript:
can I write to a local .txt File


No, not in the standard browser security environment.

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 20 '05 #3
> can I write to a local .txt File

Perhaps you meant "JavaScript"? Yes, in the right runtime environment.
Here are two environments that can:

Sash: http://sash.alphaworks.ibm.com/
WSH:
http://msdn.microsoft.com/library/de...ScriptHost.asp

The webbrowser environment does not ordinarily permit this.

http://www.crockford.com/#javascript

Jul 20 '05 #4
"Rickli Hansueli" <ri****@rickli.com> wrote in message
news:3f**********@news.bluewin.ch...
javascript:
can I write to a local .txt File
as exaple:

open() ....writel(() ...close()..... ....save as ... c:\test.txt


In the standard web environment no, but on your local PC you can, e.g.

var fso = new ActiveXObject("Scripting.FileSystemObject");
var myfile = fso.CreateTextFile("c:\\myfile.txt", true);
myfile.WriteLine("Some test.");
myfile.Close();

Search Google for FileSystemObject for more information.

If you have some antivirus program, it may stop the script.

Vjekoslav
Jul 20 '05 #5
A previous post shows an IE only method, if you want to do the same
thing in Mozilla or Netscape 7 then have a look at this tip:

http://www.faqts.com/knowledge_base/...d/23360/fid/53



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Thomas | last post by:
What's the quickest way to write and read 10.000 integer values ( or more ) to and from a file? Using struct somehow? The example in the docs shows how to handle to or three arguments, but is the...
0
by: Peter A. Schott | last post by:
If I want to verify that a file has finished writing before deleting the remote file, what would be the best method? Current code on Python 2.4: #filename - remote FTP server File Name...
2
by: Mark Szlazak | last post by:
All files that I will be referring to are in the same file folder. I need my javascipt file to write or save the contents of a textarea to other local files. This is for local use only on one...
2
by: Alex | last post by:
Yes you can: <html><head><script language="javascript"> SaveToFile('This is a text to save in a file', 'C:\\temp\\test.txt'); alert(read('C:\\temp\\test.txt')); function SaveToFile (text,...
0
by: Buddy Home | last post by:
Hello, I'm trying to upload a file programatically and occasionally I get the following error message. Unable to write data to the transport connection: An established connection was aborted...
3
by: Buddy Home | last post by:
Hello, I'm trying to upload a file programatically and occasionally I get the following error message. Unable to write data to the transport connection: An established connection was aborted...
3
by: eholz1 | last post by:
Hello PHP Group, I am having trouble setting permissions correctly so that the magickwand api (php 5.2) can read and write images. I usually read a file from one directory, create a magickwand...
6
by: 000dreamsound000 | last post by:
Hi I need help with to access a text file over my local network. I need to be able to create,read, write and delete the txt file on a specific machine(s) from any computer over the network. The...
12
by: Reggie | last post by:
Hi And TIA. Running VS2005 and IIS7.0. I have a procedure that copies a file to a folder in my web application. When I run the project from VS it runs fine . I'm usin IE as default viewer. But...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.