I have a program which reads a text file from the client's local drive. When i tested it in my pc, it ran ok since the server is also here. I am developing in tomcat using localhost. But when I try to use the program in another computer,say for example in computer B, it still reads the text file from my localhost instead of the text file in computer B.
Hai Bernard, You cannot read anything from client by using the file path. Whenever u read anything using file path it will take the file from machine where JVM is running. To achieve this you can use file upload option...
Hi Bernard To read a file from client side and save it into the database you need to upload it into the server..for that you should make use of file upload option. this you can write in HTML..and now to read the content of the text file make use of InputStreams in java.
Bernard Sigmund Gustav
Joined: Dec 20, 2005
Hello Badri. The file is from the scanner which downloads it to a specific path on the local. From the local, I then look at that specific path. Even if I upload the file, I would still have to look at the specific path in the local, but it cannot see or read the local drives.