We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpOther Libraries › Reading a text file from a web server
Page Index Toggle Pages: 1
Reading a text file from a web server? (Read 1019 times)
Reading a text file from a web server?
May 1st, 2007, 2:07pm
 
Allright so lets say I have a web server and I have a textfile located on it. Lets take for example, this:
http://turpspages.freehostia.com/test.txt
How could processing read it? Would it work if the "compiled" applet was located on the same web server? I tried getting it with the net library and a GET request but I must have done something wrong cause it didnt worked. Perhaps is there a way to work in conjunction with a PHP script? Because I would also need to write data... If I could open a web page with a PHP script I could write data allright but not read it. So my questions:
1)Any way to read a .txt's content thats located on a webserver?
2)Any way to write in it?
3)Any way to open a webpage or change the current page the applet is running on?

Thanks.
Re: Reading a text file from a web server?
Reply #1 - May 1st, 2007, 2:38pm
 
1: You can put a URL into loadStrings, which makes things fairly easy, though as yo umentioned, it must be on the same site that the applet is located.

2: The only way to write to it is to write some PHP that can processing can send information to, and have that write to the file.

3: http://processing.org/reference/link_.html

Re: Reading a text file from a web server?
Reply #2 - May 1st, 2007, 10:55pm
 
Well thanks a lot for those answers!
Page Index Toggle Pages: 1