ftp question

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
richardmac
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 211
Joined: Sun Oct 24, 2010 12:13 am

ftp question

Post by richardmac » Wed Jun 29, 2011 2:51 pm

I am attempting to upload a file to an ftp server inside a LiveCode script. The trick is that the upload has to be able to overwrite the file on the ftp server. I've gotten close using the following command:

put myInformation into URL "ftp://username:password@10.1.12.21/Data ... school.txt"

This worked... and then it didn't. And it won't override the file on the server. Any help appreciated, including telling me that there's a much easier way if I'm missing something. Thanks!

bangkok
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 937
Joined: Fri Aug 15, 2008 7:15 am

Re: ftp question

Post by bangkok » Wed Jun 29, 2011 2:55 pm

One solution is to delete the file, first.

constant FTPHOST = "wwwwwwwwwwwwwww"
constant FTPUSER = "xxxxxxxxxxxxx"
constant FTPPASS = "yyyyyyyyyyyyyy"

get libURLftpCommand("DELE "&theFileName,FTPHOST,FTPUSER,FTPPASS)

Post Reply