Results 1 to 2 of 2

Thread: Save .txt file

  1. #1
    Moose is offline Member
    Join Date
    Oct 2010
    Rep Power

    Default Save .txt file

    Hi, I'm not a programer but I've been ask to make a small applet for a Intranet page for my job. Basically, I want people to go on a page, type some comments for themself, so when they go back on that page again, they are abble to see what they just typed.

    I thought about saving a txt file on the C: drive of the person, so like that, only them will have acces to their comment. I know that for security issues, I can't just save file on a person's computer, but I heard that if you prompt a window and the user save the file where he want, it can works.

    (Basically my program is a gui with a text area and a save button. You type your text, you save and you can see it when you come back on that page)

    So, first question, can I do that?
    2, How?
    3, If I can't, am I screwed?

    TY folks!

  2. #2
    wjncross is offline Member
    Join Date
    Oct 2010
    Rep Power


    You can write to your local file system from an Applet but this will require you to request access from each user and you will/should sign your code as you are giving external code access to the local file system.

    If you google for "Applet local file access" you will come up with loads of examples.

    I think you are better off having your comments stored on the web server supplying the Applet or hosting the html page. This way you do not need to sign your code and can either tie comments to a user and/or client machine (e.g. comments follow user across different machines or comments are tied to the browser that originally entered them)

    To do the above you will need to create a CGI type page on the server to interact with the Applet to save and supply comments for the user for that page.

    I think this would be simpler to implement and will scare the end-users less (no security popups).

Similar Threads

  1. Save File Function
    By Jovan in forum New To Java
    Replies: 5
    Last Post: 06-02-2010, 03:27 AM
  2. save file based on file extension
    By masa in forum AWT / Swing
    Replies: 4
    Last Post: 05-11-2010, 12:17 PM
  3. Replies: 0
    Last Post: 03-05-2010, 05:21 AM
  4. Save file
    By dejos456 in forum New To Java
    Replies: 4
    Last Post: 11-28-2009, 04:13 PM
  5. how to save file..
    By jont717 in forum New To Java
    Replies: 2
    Last Post: 02-13-2009, 12:33 AM

Posting Permissions

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