Click to See Complete Forum and Search --> : Applet and random access files


TimmZ
May 11th, 2000, 11:30 AM
Excuse me for my bad english as I'm french: I 've got an applet which uses several text files.
When I run the program from a server(or a distant computer), how can I have a random access to the text files using URL ?
Otherwise is there another way to read this files ?
How can I go trough the Java security ??
Thank you
you can mail me at roger.simeon@*******.com

dogbear
May 12th, 2000, 10:07 AM
TimmZ,

Excuse my English... for I am an American. :).

Are the text files located on the Server side?
If so, there are alot of security problems to consider at the Server side.
Are you in the position to rewrite the server as to have it send you the files instead of having the Applet trying to access them itself?

Regards,
dogBear

TimmZ
May 15th, 2000, 04:16 PM
We can't download the files because they are too much big (severals Mo).
How can we do, in order to reach them on the server-side ?
Thanks for your help
TimmZ

bharath
May 16th, 2000, 01:48 AM
hai TimmZ,

There would't be any problem when u ar reading the data from the file.

Hope the following code will help u.

try
{
URL url=new URL(getCodeBase(),"temp.txt");
URLConnection con=url.openConnection();
InputStream in=con.getInputStream();
DataInputStream result=new DataInputStream(in);
String text = (String)result.readUTF();
}
catch(Exception e)
{System.out.println("e"+e);}

if any problem mail me

bye

-bharath


S.V Bharath Reddy
Software Engineer,
Hyderabad.

dogbear
May 16th, 2000, 04:46 AM
TimmyZ,

Thanks for the rating...
But I haven't done much to help you yet!

This seems like a complicated problem.

From what I know, if the text file you want
the applet to read is several Mb's in size,
you must devise a system to give the
Applet the information it needs. Perhaps
the server can be rewritten to read the text
file, compress it, and then send it to the
Applet. OR perhaps the server can read the
text file and send only the information the
Applet requires.

There are many ways to solve this problem.
Perhaps if you give us more details we can
better help.

Regards,
dogBear

meenumgupta
May 23rd, 2005, 10:44 PM
Hi,

I have a requirement quite similar to the one you had mentioned. My requirement is that i have files (excel,doc,pdf) on the server, i need to show these files on the clients machine (without downloading) and changes made by user should be saved back to server.
If anyone can help me out in this, wil be of great help.

Thanks a lot.

Meenu