954,518 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

How to send text to a text file using j2me through http connection?

Regarding the title, i want to know the exact way to writing text data to a text file on a web server using http connection in J2ME. I tried the way as below:

OutputConnection connection=)OutputConnection)Connector.open("http://localhost/message.txt;append=true",Connector.WRITE);
OutputStream out=connection.openOutputStream();
PrintStream output=new PrintStream(out);
output.println("Testing");
out.close();

the codes have no problem and no exception. But when i open the text file, nothing printed to the text file. Anybody has the appropriate solution?

yeap521
Newbie Poster
1 post since Sep 2004
Reputation Points: 10
Solved Threads: 0
 

you r writing data to only port no. 80,you r not reading data from that port,http port is 80,so you must know the server side programming.so you can read it and save in message.txt file on server side,so u have to write code for it also.

pradip.shingate
Newbie Poster
1 post since Apr 2010
Reputation Points: 10
Solved Threads: 0
 

@pradip.shingate well done you just replayed to almost 6 years old thread with information of very little value...

Thread closed!

peter_budo
Code tags enforcer
Moderator
15,436 posts since Dec 2004
Reputation Points: 2,806
Solved Threads: 902
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You