Storing and Retrieving stack data?

Phil Davis revdev at pdslabs.net
Tue Jun 3 19:48:34 EDT 2008


Hi John,

I'm assuming only the teacher app would be downloading stuff created by 
student apps.

Good news: You only need FTP for uploading files to a server that isn't 
on your LAN.
To download data (whether stacks or some other files), you can use "put 
url" no matter where the files are.

-- download a text file from the web
put url "http://my.webserver.com/files/student1.txt" into tStudentText

-- open a stack from the web
go url "http://my.web.server.com/files/student2.rev"

-- download and save a stack from the web
ask file "Save as:"
if it = empty then exit to top
put url "http://my.web.server.com/files/student2.rev" into url 
("binfile:" & it)

There are more sophisticated ways to do it, and there are sometimes good 
reasons why you might need to use them. But this will get the job done.

Maybe this answers at least part of your question.
Phil Davis


John Patten wrote:
> Hello All!
>
> I would like to save some user (student) input out of one rev project and have it accessible to another rev project (teacher) to generate reports. The users of the project could be on a school network (LAN/WAN) or at home on the Internet. What is the best way to save the data?  What is the most common practice for saving the data for this type of project? 
>
> Possible ideas...
>
> FTP user data as individual files to a ftp server? (Run through a process of reading back all the files in the directory to create report.)
>
> Send user data directly to mySQL database? (Require the mySQL database to be open to outside connections - direct connect to mySQL?)
>
> Send user data as a post process, using a CGI script to send data to mySQL database on server?
>
>
> The first idea seems the easiest, but I'm afraid could get to be pretty slow with a couple hundred files in the ftp directory. I could modify an existing file on the ftp server, however I run the risk of some data not being written to the file if simultaneous connections occur...?
>
> I have not done any work with Rev and mySQL, so if I could get away from the sql commands, all the better :-)  But, if it would be the best way to go, I'm willing to focus on that area. 
>
> Any ideas?
>
> Thank you!
>
> John Patten

-- 
Phil Davis

PDS Labs
Professional Software Development
http://pdslabs.net




More information about the use-livecode mailing list