Visual Basic - FTP Send File

Life is soft - evento anual de software empresarial
 
Vista:

FTP Send File

Publicado por Juan D (5 intervenciones) el 27/02/2002 15:26:40
Como puedo enviar un archivo TXT via FTP?
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:FTP Send File

Publicado por Adolfo (45 intervenciones) el 28/02/2002 11:35:53
hola juan
este es un código que uso yo.
Primero declaro las funciones de la API que necesito
y después hay una función a la que le pasa el archivo de origen y destino (ruta completa), la direccion IP, el login y password y un flag por si quieres colgar o descargar el archivo, y devuelve true o false si ha sido correcto
Espero que te valga. un saludo, Adolfo

'Funciones de FTP
Private Const INTERNET_OPEN_TYPE_PRECONFIG = 0 ' use registry configuration
Private Const INTERNET_DEFAULT_FTP_PORT = 21 ' default for FTP servers
Private Const INTERNET_SERVICE_FTP = 1
Private Const PassiveConnection As Boolean = True
Private Const INTERNET_FLAG_PASSIVE = &H8000000 ' used for FTP connections
Private Const FTP_TRANSFER_TYPE_UNKNOWN = &H0
Private Declare Function FtpGetFile Lib "wininet.dll" Alias "FtpGetFileA" (ByVal hConnect As Long, ByVal lpszRemoteFile As String, ByVal lpszNewFile As String, ByVal fFailIfExists As Long, ByVal dwFlagsAndAttributes As Long, ByVal dwFlags As Long, ByRef dwContext As Long) As Boolean
Private Declare Function FtpPutFile Lib "wininet.dll" Alias "FtpPutFileA" (ByVal hConnect As Long, ByVal lpszLocalFile As String, ByVal lpszNewRemoteFile As String, ByVal dwFlags As Long, ByVal dwContext As Long) As Boolean
Private Declare Function InternetConnect Lib "wininet.dll" Alias "InternetConnectA" (ByVal hInternetSession As Long, ByVal sServerName As String, ByVal nServerPort As Integer, ByVal sUserName As String, ByVal sPassword As String, ByVal lService As Long, ByVal lFlags As Long, ByVal lContext As Long) As Long
Private Declare Function InternetOpen Lib "winin
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar