Ftp - Getting a file
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Ftp - Getting a file
Having owned RunRev for over a year, I'm finally getting chance to play with it. In particular I'd like to write something that will download a specific file from a server using FTP - can anyone point me to a resource, document or example that shows how this can be done?
-
- VIP Livecode Opensource Backer
- Posts: 977
- Joined: Sat Apr 08, 2006 7:47 am
- Location: Aalst, Belgium
- Contact:
In addition to Klaus' suggestions, check out the 'URL' keyword.
Basically, it can be as easy as:
Hope this helped,
Jan Schenkel.
Basically, it can be as easy as:
Code: Select all
on mouseUp
ask file "Save as:"
if it is empty then exit mouseUp
put "binfile:" & it into tLocalPath
put "ftp://user:password@example.net/dir/file.ext" into tRemotePath
put URL tRemotePath into URL tLocalPath
end mouseUp
Jan Schenkel.
Quartam Reports & PDF Library for LiveCode
www.quartam.com
www.quartam.com
Me again...
I've created a stack that now asks for the URL, username and password of the server. The filename, for now, is fixed. The code I have so far is this:
I'm putting in nonsense data for the ftp details to force it to fail, however I'm not getting any error in the 'result' field.
Am I doing something stupid?
I've created a stack that now asks for the URL, username and password of the server. The filename, for now, is fixed. The code I have so far is this:
Code: Select all
on mouseUp
put "" into field "lblResult"
if field "lblFile" is empty then exit mouseUp
put "binfile:" & field "lblFile" into tLocalPath
put "ftp://" & field "usernameField" & ":" & field "passwordField" & "@" & field "ftpField" & "/database.sql" into tRemotePath
put URL tRemotePath into URL tLocalPath
put the result into field "lblResult"
end mouseUp
Am I doing something stupid?