CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    May 2000
    Posts
    2

    Applet and random access files

    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



  2. #2
    Join Date
    Mar 2000
    Location
    Dublin, Ireland
    Posts
    124

    Re: Applet and random access files

    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


  3. #3
    Join Date
    May 2000
    Posts
    2

    Re: Applet and random access files

    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


  4. #4
    Join Date
    Apr 2000
    Location
    Hyderabad, India
    Posts
    23

    Re: Applet and random access files

    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.

  5. #5
    Join Date
    Mar 2000
    Location
    Dublin, Ireland
    Posts
    124

    Re: Applet and random access files

    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


  6. #6
    Join Date
    May 2005
    Posts
    1

    Re: Applet and files on the server

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured