Aruniima

If the file you want to access is client-side, and your clients are IE, and
you get your users to set IE's permissions to allow it, you can use the
FileSystemObject to read/write the file. Here is an example from MSDN

var fso = new ActiveXObject("Scripting.FileSystemObject");
var a = fso.CreateTextFile("c:\\testfile.txt", true);
a.WriteLine("This is a test.");
a.Close();

The example writes to a file, but reading is easy too. You can read the file
into a string and then set it into a DIV element, perhaps, e.g.

mydiv.innerText = mystringwithfilecontents;

regards

Mark Lines-Davies

-----Original Message-----
From: A mailing list about Java Server Pages specification and reference
[mailto:[EMAIL PROTECTED]]On Behalf Of [Aruniima Chakrabarti]
Sent: 05 February 2002 11:17
To: [EMAIL PROTECTED]
Subject:


I want to open a file in the same window where the file name is specified at
runtime. i.e if I have a file called  "xyz.txt",
I should be able to see the file contents in same browser window.
Thank you for your time. Any help is welcome as I am completely new to
Javascript.

Regards,
aruniima

 -----Original Message-----
From:   Sabari Arasu (CTC) [mailto:[EMAIL PROTECTED]]
Sent:   Tuesday, February 05, 2002 4:50 PM
To:     [EMAIL PROTECTED]
Subject:

Do u want to open the file dialog box thru JavaScript???

Sabari Arasu
AIG - TCS
Chennai
India

> -----Original Message-----
> From: [Aruniima Chakrabarti]
> [SMTP:[EMAIL PROTECTED]]
> Sent: Tuesday, February 05, 2002 4:38 PM
> To:   [EMAIL PROTECTED]
> Subject:
>
> Hello everyone,
>         I need to read a file in an html page. Could anyone help me to
> read
> a file using JavaScript? I am using JavaScript for the first time. Kindly
> help.
>  Very sorry for posting a non-jsp question.
>
> Regards,
> aruniima
>
> --------------------------------------------------------------------------
> --
>
> This message contains privileged and confidential information and is
> intended only for the individual named. If you are not the intended
> recipient you should not disseminate, distribute, store, print, copy or
> deliver this message. Please notify the sender immediately by e-mail if
> you
> have received this e-mail by mistake and immediately delete this e-mail
> from
> your system.
>
>
> E-mail transmission cannot be guaranteed to be secure or error-free as
> information could be intercepted, corrupted, lost, destroyed, arrive late
> or
> incomplete, or contain viruses. The sender therefore does not accept
> liability for any errors or omissions in the contents of this message
> which
> arise as a result of e-mail transmission.  If verification is required
> please request a hard-copy version.
>
>
> --------------------------------------------------------------------------
>
> ==========================================================================
> =
> To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
> JSP-INTEREST".
> For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
> DIGEST".
> Some relevant FAQs on JSP/Servlets can be found at:
>
>  http://archives.java.sun.com/jsp-interest.html
>  http://java.sun.com/products/jsp/faq.html
>  http://www.esperanto.org.nz/jsp/jspfaq.jsp
>  http://www.jguru.com/faq/index.jsp
>  http://www.jspinsider.com

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com
----------------------------------------------------------------------------

This message contains privileged and confidential information and is
intended only for the individual named. If you are not the intended
recipient you should not disseminate, distribute, store, print, copy or
deliver this message. Please notify the sender immediately by e-mail if you
have received this e-mail by mistake and immediately delete this e-mail from
your system.


E-mail transmission cannot be guaranteed to be secure or error-free as
information could be intercepted, corrupted, lost, destroyed, arrive late or
incomplete, or contain viruses. The sender therefore does not accept
liability for any errors or omissions in the contents of this message which
arise as a result of e-mail transmission.  If verification is required
please request a hard-copy version.


--------------------------------------------------------------------------

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff
JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST
DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com



*************************************************************************
The information contained in this message or any of its
attachments may be privileged and confidential and intended
for the exclusive use of the addressee. If you are not the
addressee any disclosure, reproduction, distribution or other
dissemination or use of this communication is strictly prohibited
*************************************************************************

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to