Revlet save a txt file

Devin Asay devin_asay at byu.edu
Tue Jul 28 13:39:06 EDT 2009


On Jul 28, 2009, at 11:20 AM, Howard Bornstein wrote:

> On Sun, Jul 26, 2009 at 12:51 PM, Richard Gaskin <ambassador at fourthworld.com
>> wrote:
>
>> Yves COPPE wrote:
>>
>> 1) how can I save the txt file on my personal web site  (it is not a
>>> rev-server)
>>>
>>
>> Two ways to send data to a server are FTP and POST via HTTP.  From  
>> anything
>> running on a public client FTP would expose your password  
>> unnecessarily, so
>> using POST to send the data to a CGI would probably be the better  
>> option.
>
>
> I have been wondering about this also and am confused as to why the  
> standard
> read and write file commands would not work. The revlet is sitting  
> in a
> directory on a server, just like a stack sits in a directory on your  
> local
> hard disk. You want to read or write a file in a directory relative  
> to the
> stack or revlet. So why wouldn't
>
> open file fpath for write -- where fpath is the directory your  
> revlet is
> in, for example
> write fld "data" to file fpath
> close file fpath
>
> work on the server just like it works on your local hard drive,  
> especially
> if the plugin is supposed to support virtually all of Rev's commands?

It won't work because of the security model the web is based on.  
Client processes cannot write to a web server. The only way to get  
around this is to FTP from the client, POST data to a server side  
script of some kind (CGI, PHP) or store the data in a server-side  
database such as MySQL.

A revlet can write to the local file system (although it seems we're  
unsure of whether open file/write to file works), but only if the user  
gives permission.

Hope I'm understanding the question.

Devin


Devin Asay
Humanities Technology and Research Support Center
Brigham Young University




More information about the use-livecode mailing list