Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 4 of 4

Thread: Appending to online documents

  1. #1
    Forum VIP
    Join Date
    Jul 2010
    Posts
    1,676
    Thanks
    25
    Thanked 329 Times in 305 Posts

    Default Appending to online documents

    Ok, I have a fairly simple question. I need to figure out a way to, from an embedded applet, append to a text document in the same location as the applet (online server).

    Now, in order to communicate with the files on the server, I need to use Streams. The problem is the only OutputStream I can find that supports appending is FileOutputStream. I cannot use FileOutputStream since it requires me to send it a File and all I have is a URL and a URLConnection.

    I have no idea what to do. Does anyone have any suggestions for me?
    NOTE TO NEW PEOPLE LOOKING FOR HELP ON FORUM:

    When asking for help, please follow these guidelines to receive better and more prompt help:
    1. Put your code in Java Tags. To do this, put [highlight=java] before your code and [/highlight] after your code.
    2. Give full details of errors and provide us with as much information about the situation as possible.
    3. Give us an example of what the output should look like when done correctly.

    Join the Airline Management Simulation Game to manage your own airline against other users in a virtual recreation of the United States Airline Industry. For more details, visit: http://airlinegame.orgfree.com/


  2. #2
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,162
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: Appending to online documents

    append to a text document in the same location as the applet
    To write to a file, there must be program executing on the same computer as the file is on.
    Your applet would have to give that program the data that is to be appended to the file.
    Choices of programs to do the writing would depend on what the server offers: cgi-bin, servlet, php, ???

  3. #3
    Forum VIP
    Join Date
    Jul 2010
    Posts
    1,676
    Thanks
    25
    Thanked 329 Times in 305 Posts

    Default Re: Appending to online documents

    I'm writing to an online text file via ftp, not a file on anyone's machine.

    My issue isn't with writing to an online text file, it is specifically appending to an online text file, instead of overwriting it.
    NOTE TO NEW PEOPLE LOOKING FOR HELP ON FORUM:

    When asking for help, please follow these guidelines to receive better and more prompt help:
    1. Put your code in Java Tags. To do this, put [highlight=java] before your code and [/highlight] after your code.
    2. Give full details of errors and provide us with as much information about the situation as possible.
    3. Give us an example of what the output should look like when done correctly.

    Join the Airline Management Simulation Game to manage your own airline against other users in a virtual recreation of the United States Airline Industry. For more details, visit: http://airlinegame.orgfree.com/

  4. #4
    Super Moderator Norm's Avatar
    Join Date
    May 2010
    Location
    Eastern Florida
    Posts
    25,162
    Thanks
    65
    Thanked 2,725 Times in 2,675 Posts

    Default Re: Appending to online documents

    not a file on anyone's machine.
    I assume that the file is on the server's machine. If not where is it?

    via ftp
    Then is your question: Using FTP how do you append to a file?
    What are the options with FTP?
    You might have to read the whole file, do the append and then write the whole file back.

Similar Threads

  1. online system on java
    By u-khan1 in forum Paid Java Projects
    Replies: 0
    Last Post: March 8th, 2011, 06:02 AM
  2. [SOLVED] Specific Text Extraction from PDF Research paper documents
    By user101 in forum Threads
    Replies: 1
    Last Post: September 8th, 2010, 11:30 AM
  3. Appending to excel using POI
    By krishnamohan in forum Java Theory & Questions
    Replies: 8
    Last Post: August 19th, 2010, 05:40 AM
  4. appending from shell script to excel sheet
    By krishnamohan in forum Java Theory & Questions
    Replies: 1
    Last Post: August 16th, 2010, 10:01 AM
  5. Reading the size (height and width) of word documents
    By pradeep_das in forum File I/O & Other I/O Streams
    Replies: 1
    Last Post: May 7th, 2010, 09:58 AM