View Full Version : script loading datafile over http


gezmond
06-27-2005, 02:57 AM
Hi..

I am writing a script to read a CSV file and place text in layers, etc.. it works using a local datafile, but as everything we do is database or XML managed, I'd like to call a script to return the data.. but I can't get it to work over http. I am trying to us this:

var dbText = new File('http://www.myDomain.com/data.php');
dbText.open ('r');

and then read the lines into a array..

anyone tried this? any suggestions?

Thanks
Gez

byRo
06-27-2005, 05:18 AM
Hi there, Gez, welcome to RetouchPRO :bigthmb: :bigthmb:

Sorry, I can't help "off the bat". If nobody replies before, I'll do some homework tonight.


westworld
09-30-2005, 12:42 PM
I dont know what scripting language u use. On Windows pc I'd say, go for the wget application. This is a command line tool that lets you download files from internet. Then just bind it all together with vbscript. (done this with xls files and it worked great). Or you might try using javascript, I think you can use the xmlhttp library (the new tool to use:-)= buzz about ajax is about this library). Don't know if this works on mac as well. Thy searching google for ajax or xmlhttp. There's a few good guides on how to use it.(returns text or xml)

Hope this helped

xbytor
10-02-2005, 10:07 AM
The PSJS implementation does not support the 'new File("http://whatever.com")' syntax. You will need to write a script that you invoke via 'File.execute()'. Taking this route lets you choose from a bunch of different options, including stuff like perl, python, lynx, and wget. I'm using the cygwin environment, so perl would be a natural choice for me.