FTP Requests

Ray Horsley Ray at LinkItOnline.Com
Fri Dec 12 11:37:47 EST 2003


This might be of use to anyone using the libURL commands.  I've discovered
that deleting an ftp file as in "delete url myUrl" does not work if messages
are locked at the time this command is sent.  The other url commands, as far
as I can tell, are not effected by locked messages.

Thanks again for Dave Cragg's help on this.

Ray Horsley
Developer, LinkIt! Software

On 12/11/03 7:42 PM, "Dave Cragg" <dcragg at lacscentre.co.uk> wrote:

> At 2:11 pm -0500 11/12/03, Ray Horsley wrote:
>> Hi Listers,
>> 
>> I'm currently working on a project using Metacard's ability to move files
>> between my local computer and an FTP site.  I'm using the following syntax:
>> 
>> Put url "ftp://userName:userPassword@mySite.com/myFolder/myFile/" into
>> myLocalFilePath
>> 
>> Can anybody help me with the syntax to also do the following:
>> 
>>    1)   delete an FTP file
> 
> As Klaus said, delete url ftp://whatever
> 
>>    2)   change the directory of an FTP file (without having to rewrite it)
> 
> I take it you mean change the directory name and not move files to a
> different directory.
> 
> This is a bit messy, but can be done with libUrlFtpCommand.
> 
> First use the CWD command to change to the directory that contains
> the one you want to change. Then use RNFR and RNFT to change the name.
> 
> put "ftp.myserver.com" into tHost
> put "dave" into tName
> put "secret" into tPass
> put "olddirname" into tFrom
> put "newdirname" into tTo
> put "CWD /path/to/parent/folder" into tCmd
> get libUrlFtpCommand(tCmd,tHost,tName,tPass)
> if word 1 of it is 250 then ##check for success
>   put  put "RNFR" && tFrom into tCmd
>   get libUrlFtpCommand(tCmd,tHost,tName,tPass)
>   if word 1 of it is 350 then##really 350 this time
>      put  put "RNTO" && tTo into tCmd
>      get libUrlFtpCommand(tCmd,tHost,tName,tPass)
>      if word 1 of it is not 250 then
>       ## error stuff
>      end if
>   end if
> end if
> 
> By the way, if you have Fetch on a Mac, a good way to discover the
> FTP command syntax is to open the transcript window, perform the
> actions you want to emulate, and note the commands that were issued.
> (I guess other FTP clients probably have the same feature.)
> 
> Cheers
> Dave
> _______________________________________________
> metacard mailing list
> metacard at lists.runrev.com
> http://lists.runrev.com/mailman/listinfo/metacard



More information about the metacard mailing list