This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Java Script for File Handling Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Java Script for File Handling" Watch "Java Script for File Handling" New topic
Author

Java Script for File Handling

Anurag Mishra
Ranch Hand

Joined: Jun 16, 2003
Posts: 121
Hi,
I want to write a java script which will read a file from a directory then it will match a word <HTML> in a file and then it will append <TEST>
just before the <HTML>.
If anyone has done this type of java script or have some idea pls reply.
thanks in advance.


SCJP 1.2
Tom Blough
Ranch Hand

Joined: Jul 31, 2003
Posts: 263
JavaScript does not allow access to the underlying file system. I don't think you will be able to do what you want. If this is a program that will run on a local machine, you could use Java or any other programming language to accomplish this.


Tom Blough<br /> <blockquote><font size="1" face="Verdana, Arial">quote:</font><hr>Cum catapultae proscriptae erunt tum soli proscripti catapultas habebunt.<hr></blockquote>
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60800
    
  65

If this operation is to be performed on the server, a servlet is probably your best bet. If this is a client-side operation you are out of luck as no client-side file access can be performed (think of the security implications otherwise) except via a signed applet.
bear


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Java Script for File Handling
 
Similar Threads
Reference java script in servlet code
User data from java object to assign javascript variables
Applet doesn't respond???
Large amount of HTML output
Javscript problem