FTP Help Please

JACK RARICK JRARICK at hpsk12.net
Sat Mar 13 11:18:54 EST 2010


Wow!

Incredible responses from both Richard and Richmond!

Thank you both!

And yes ... did the trick!

Thanks again!

Jack Rarick
Holt Public Schools
Holt MI  48842
________________________________________
From: use-revolution-bounces at lists.runrev.com [use-revolution-bounces at lists.runrev.com] On Behalf Of Richard Gaskin [ambassador at fourthworld.com]
Sent: Saturday, March 13, 2010 11:15 AM
To: How to use Revolution
Subject: Re: FTP Help Please

JACK RARICK wrote:
 > I have searched the archives - but obviously not well enough
 > - for a stack or help in using FTP from a stack.
 >
 > Does anyone know of a stack out there that I could tear apart
 > (which is how I learn best) and learn the following:
 >
 > How to connect to an FTP server. (I have one on driveHQ)

You're about to have a very good time. :)

Explicit connection isn't needed - libURL handles that for you whenever
you use one of its file transfer commands.

 > How to upload a text file or image to that server.

put url ("file:"& tMyLocalFile) into url tMyServerUrl

Where tMyServerUrl is in the standard format for including protocol,
login, and password, e.g:

ftp://user:password@ftp.domain.com/folder/filename.txt

 > How to download a different text file or image from that server.

Same thing but in reverse:

put url tMyServerUrl into url ("file:"& tMyLocalFile)

Yep, thanks to Dave Cragg and the others who've worked on Rev's libURL,
it's that easy. :)

There's a lot more libURL can do too, including providing callbacks to
let you know when a file is done transferring so you can take further
action, or providing status updates during the transfer so you can use a
progress bar.  But for small text files you probably won't need a
progress bar because they'll transfer so fast.  Just check "the result"
after each libURL call to see if anything went wrong, and take
appropriate action from there:

put url tMyServerUrl into url ("file:"& tMyLocalFile)
if the result is not empty then
    answer "An error occurred while downloading: "& the result
    exit to top
end if

Complete docs and other helpful notes on libURL are in the RevTalk
Dictionary and here:
<http://www.lacscentre.com/liburl/liburldoc.html>

--
  Richard Gaskin
  Fourth World
  Rev training and consulting: http://www.fourthworld.com
  Webzine for Rev developers: http://www.revjournal.com
  revJournal blog: http://revjournal.com/blog.irv
_______________________________________________
use-revolution mailing list
use-revolution at lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution

--
This email was Anti Virus checked by Astaro Security Gateway. http://www.astaro.com



More information about the use-livecode mailing list