on-rev writing to

Sarah Reichelt sarah.reichelt at gmail.com
Sun May 1 05:11:34 EDT 2011


Tom, you cannot write directly to a server.
You can upload a file using your FTP login details.
But the best solution for your case is to have an irev file on the server that you can call using http://.... And send some data to via POST or GET. Then have the irev file do the actual writing.

Not at my Mac right now, so can't give actual examples, but here is the process in untested code:

In your script on the desktop:

put "http://tom.on-rev.com/writeData.irev" into tURL
put "data=" & urlEncode(tDataToWrite) into tPostData
post tPostData to URL tURL


In the writeData.irev file on the server:

put $_POST["data"] into tNewData
put tNewData into URL ("file:dataFile.txt")

Images will work the same way, but you need to read in the data using binfile:, not file:
Then base64encode the binary data before POSTing it.

Cheers,
Sarah


Sent from my iPad

On 01/05/2011, at 1:58 AM, Thomas McGrath III <mcgrath3 at mac.com> wrote:

> I need to know how to write to on-rev from within an iOS app.
> 
> Is there a best practices around?
> 
> I need to write a folder to my account and then write a text file and some images.
> 
> Are there any sample stacks that show this?
> 
> Is it as simple as put img 1 into url "http://etc."
> 
> or is this something for libURL? ( I haven't used libURL before)
> 
> Any guidance appreciated.
> 
> -- Tom McGrath III
> http://lazyriver.on-rev.com
> 3mcgrath at comcast.net
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode




More information about the use-livecode mailing list