Aktive FTP Mode Support
Aktive FTP Mode Support
It would be great if active FTP Mode would also be supportet.
PureBasic 4.51 (x86), Windows 7 (32bit), T5600
-
- 666
- Posts: 1033
- Joined: Mon Sep 01, 2003 2:33 pm
Re: Aktive FTP Mode Support
It already is.
The Documentation wrote: Syntax
Result = OpenFTP(#Ftp, ServerName$, User$, Password$ [, Passive [, Port]])
Description
Try to open a connection on the specified FTP server. If #PB_Any is used as '#Ftp' parameter, the new ftp number will be returned as 'Result'. 'ServerName$' has to be a valid ftp server adress. 'User$' and 'Password$' will be used to authenticate on the server. For public server, 'User$' can be set to "anonymous" and 'Password$' be let empty. By default the connection is opened in passive mode, as it's the most compliant mode (most PC have a firewall which will complain if a ftp connection is initialized in active mode). The default port is 21 but can be overriden with the 'Port' parameter.
If the connection to the server can't be successly completed, 'Result' will be 0.
InitNetwork() has to be called before using this command, as all the FTP commands are based on the network library.
Example:
Supported OSCode: Select all
InitNetwork() If OpenFTP(0, "ftp.free.fr", "anonymous", "") Debug "Successfully connected" Else Debug "Can't connect to ftp.free.fr" EndIf
All
Re: Aktive FTP Mode Support
I am afraid it isnt. I have been playing around some time
with it, and it does not support active FTP. I had read the help
and played around with the passive variable.
An active server connection uses Port 80 and 81 on the server
side. The PB command does not do that. I also double checked
with another FTP client, which works according the defintion.
So at the beginning I thought this was a bug - but reading the
help file again and again, I concluded:
1. It does not say active mode is supported.
2. It does not mention what value "passiv" has to have, to
have active mode. (0 or #Null do not work.)
3. Normally the help file says this very precise. It even
states that if the result of the command is 0 it failed-
which is quiet obvious.
At short I suppose the Varibale can be only set to passiv
(1) but it is needed for the to next parameter "port".
I can only change the port, wenn I fill the passiv
parameter. Maybe passiv its thought for later expansions.
At least I could not get working active in any way.
with it, and it does not support active FTP. I had read the help
and played around with the passive variable.
An active server connection uses Port 80 and 81 on the server
side. The PB command does not do that. I also double checked
with another FTP client, which works according the defintion.
So at the beginning I thought this was a bug - but reading the
help file again and again, I concluded:
1. It does not say active mode is supported.
2. It does not mention what value "passiv" has to have, to
have active mode. (0 or #Null do not work.)
3. Normally the help file says this very precise. It even
states that if the result of the command is 0 it failed-
which is quiet obvious.
At short I suppose the Varibale can be only set to passiv
(1) but it is needed for the to next parameter "port".
I can only change the port, wenn I fill the passiv
parameter. Maybe passiv its thought for later expansions.
At least I could not get working active in any way.
PureBasic 4.51 (x86), Windows 7 (32bit), T5600