Re: libURLFTPCommand problems

2010-06-04 Thread Dave Cragg

On 4 Jun 2010, at 17:42, Jeff Massung wrote:

> I cannot seem to get this to work. Well, to be clear, the function works
> just fine, but none of the commands are working. For example, a simple test:
> 
> put libURLFtpCommand("ls", "my.ftp.site", "username", "password")
> 
> Every time this will put "500 Command not found". However, if I just ftp
> into the account I can do "ls" all day long and it works just fine. I've
> tried DIR, NLST, LIST, caps combinations, etc. PWD works, but almost every
> other command fails.
> 
> Any ideas? Thanks!


You could try "SITE ls" as the command. "ls" isn't a standard ftp command, but 
many servers support it.

If you just want a directory listing, you can use "get url" with the url to the 
directory.

Ex:  get url "ftp://myName:mypassw...@my.server.com/myDirectory/";

If you do want to use "ls" or "LIST" yourself, you have a bit of work to do.

FTP commands go over a "control connection". Commands that result in "data 
transfer" (such as STOR, RETR, LIST, NLST) require a separate connection to 
transfer the data. libURLFtpCommand just sends commands and returns responses 
over the "control connection". Commands such as PWD only use the "control 
connection" and so work fine.

To conduct a LIST command fully, the sequence goes something like this:

-- send CWD command to switch to the directory you ned to list
-- send the PASV command to initiate opening a data socket
-- read the response (should be 227) and parse the IP address and port 
information returned
typical response looks like this:  227 Entering Passive Mode 
(173,175,12,250,15,28)
-- open a socket to the IP address and port you've just parsed
-- send the LIST command with the appropriate path data
-- wait for a 150 response (indication that the server is ready)
-- read from the socket you opened previously until it closes

It's not a lot of fun. :-)


Cheers
Dave




___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution


Re: libURLFTPCommand problems

2010-06-04 Thread Michael Kann
Mark, 

It looks like we get three more commands to work with:
--
-- output from following script
--
214-The following SITE commands are recognized

 ALIAS

 CHMOD

 IDLE

 UTIME

-- Don't know why PWD isn't listed.
--
Script:

on mouseUp
libURLSetLogField "field 1"
put libURLFtpCommand("HELP", "taishan.on-rev.com", "taishan", "pj7d89kq") into 
fld 2
end mouseUp

Not much help. Sorry.

Mike

--- On Fri, 6/4/10, Jeff Massung  wrote:

> From: Jeff Massung 
> Subject: libURLFTPCommand problems
> To: "RunRev Mailing List" 
> Date: Friday, June 4, 2010, 11:42 AM
> I cannot seem to get this to work.
> Well, to be clear, the function works
> just fine, but none of the commands are working. For
> example, a simple test:
> 
> put libURLFtpCommand("ls", "my.ftp.site", "username",
> "password")
> 
> Every time this will put "500 Command not found". However,
> if I just ftp
> into the account I can do "ls" all day long and it works
> just fine. I've
> tried DIR, NLST, LIST, caps combinations, etc. PWD works,
> but almost every
> other command fails.
> 
> Any ideas? Thanks!
> 
> Jeff M.
> ___
> use-revolution mailing list
> use-revolution@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage
> your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-revolution
> 


  
___
use-revolution mailing list
use-revolution@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-revolution