Ftp woes

Dave Cragg dcragg at lacscentre.co.uk
Tue Apr 23 01:55:01 EDT 2002


At 1:51 am -0400 23/4/02, Tim wrote:

>That did it. Thanks a bunch! Is there a way to reverse engineer this so that
>a shell stack could open this TestStack from the ftp server?

This will do it.

  put "myusername at domain.com" into tName
  put "ftp://" & urlEncode(tName) & ":mypassword" & "@" into tUrl
  put "ftp.business.earthlink.net/www/TestStack" after tUrl
  go stack decompress(url tUrl)

If it's a large stack and you want to show some kind of download 
status, consider using "load url" instead. Something like:

on mouseUp
  put "myusername at domain.com" into tName
  put "ftp://" & urlEncode(tName) & ":mypassword" & "@" into tUrl
  put "ftp.business.earthlink.net/www/TestStack" after tUrl
  load url tUrl with message "stackLoaded"
  send "showProgress" && quote & tUrl & quote to me in 100 milliseconds
end mouseUp

on showProgress pUrl
   if urlStatus(pUrl) is not among the items of "error,timeout,cached" then
    put urlStatus(pUrl) into field "status" ##or something sexier
    send "showProgress" && quote & pUrl & quote to me in 100 milliseconds
   end if
end showProgress

on stackLoaded pUrl, pStatus
  if pStatus is "cached" then
    go stack decompress(url pUrl)
    unload url pUrl ##assuming you don't need it again
  else
   #some error message here
   unload url pUrl
  end if
end stackLoaded

Cheers
Dave Cragg



More information about the use-livecode mailing list