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?
Re: Appending to online documents
Quote:
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, ???
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.
Re: Appending to online documents
Quote:
not a file on anyone's machine.
I assume that the file is on the server's machine. If not where is it?
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.