Click to See Complete Forum and Search --> : to read file content


tweety
10-18-2005, 02:10 AM
Hi,
I tried to open a text file and read its content using javascript.
The code is here:

var fso, f;
var ForReading = 1;
fso = new ActiveXObject("Scripting.FileSystemObject");
f = fso.OpenTextFile("C:\SampleCodes\Sample.txt",ForReading);
alert("File Content : " + f.ReadAll() );
f.close();


It works fine. I want to open and read an image file using javscript.
can anyone tell how to read an image file

Thanks in Advance,
Tweety :)

A1ien51
10-18-2005, 07:46 AM
By read, you want to read the binary or show the image? Why don't you just link to the image file.

Eric

tweety
10-19-2005, 06:30 AM
Thanks Alien.

I am trying to read the content of a file (the file type may be text, doc, image...)in client side and send the content to server.

so can u help me how to read the file content (other than text files..)

Thanks once again.
Tweety