información ni acceso al servidor FTP, el problema es que estaba activado el modo pasivo en el servidor, y era/es imposible subir un archivo.
En Fivewin, usando la clase TFTP, no es posible la conexión, pero eso tiene muy fácil solución, y haremos estas modificaciones a la clase TFTP,
esta en tftp.prg;
- Code: Select all Expand view
#define INTERNET_FLAG_PASSIVE 0x08000000 // Decimal: 134217728
//----------------------------------------------------------------------------//
CLASS TFTP
// Add this
DATA lPassive // Mode passive
DATA nPort // Port
METHOD New( cFTPSite, oInternet, cUserName, cPassword, lPassive , nPort ) CONSTRUCTOR // generic constructor
// Resto de codigo por aqui
ENDCLASS
//----------------------------------------------------------------------------//
// re-write method New with this code
METHOD New( cFTPSite, oInternet, cUserName, cPassword, lPassive, nPort ) CLASS TFTP
DEFAULT lPassive := .F., nPort := FTP_PORT
::oInternet = oInternet
::cSite = cFTPSite
::cUserName = cUserName
::cPassword = cPassword
::lPassive = lPassive
::nPort = nPort
if oInternet:hSession != nil
::hFTP = InternetConnect( oInternet:hSession, cFTPSite, ::nPort,;
::cUserName, ::cPassword,;
INTERNET_SERVICE_FTP, if( ::lPassive, INTERNET_FLAG_PASSIVE , 0 ), 0 )
AAdd( oInternet:aFTPs, Self )
endif
return Self
Ya esta! Ya podéis pasar también el puerto del ftp y si queremos conectar por pasivo al FTP.
Antonio, yo creo que esto es una 'pequeña' mejora que podrías añadirlo a fivewin.