Click to See Complete Forum and Search --> : file open


alfoxy
July 9th, 2002, 04:15 AM
Hello all
im very new to javascript and id appreciate a little help out of a hole ive dug myself into

basically can java script open a .txt file and read out the contents ? if so could you show me how ?

thanks a million
Al

websmith99
October 3rd, 2002, 09:49 PM
JavaScript can read the contents of files of type "text/html" (to a point) but not files of type "text/plain".

You can use perl for this.

tangjun
May 7th, 2003, 05:03 PM
can you show the code the read a file within javascript?

Satishpp
May 7th, 2003, 05:36 PM
Are you trying to read a text file on the client machine using javascipt from within the browser? If so, this is not possible due to the browsers security.

If you are using WSH (windows script host) check this out

http://www.winscripter.com/wsh/fileio/ht_readfile.asp

Satish