1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
'-----------------------------------------------------
' Tranfert du fichier localPath par ftp
'-----------------------------------------------------
Function FtpExport(ip As String, port As Integer, login As String, password As String, localPath As String, remotePath As String) As Boolean
Const funcName As String = "FtpExport()"
Dim test As String
On Error GoTo ErrorHandler
If verbosity Then DebugLog (funcName & " Tranfert de " & localPath & " vers " & remotePath & vbLf _
& vbTab & vbTab & "ip : " & ip & vbLf _
& vbTab & vbTab & "port : " & port & vbLf _
& vbTab & vbTab & "user : " & login & vbLf _
& vbTab & vbTab & "password : " & password)
frmCalendar.Inet1.AccessType = icUseDefault
frmCalendar.Inet1.URL = "ftp://" & ip
frmCalendar.Inet1.UserName = login
frmCalendar.Inet1.password = password
frmCalendar.Inet1.RemotePort = port
frmCalendar.Inet1.RequestTimeout = 40
frmCalendar.Inet1.Execute , "PUT " & localPath & " " & remotePath
Do While frmCalendar.Inet1.StillExecuting
DoEvents
Loop
frmCalendar.Inet1.Execute , "CLOSE"
ErrorHandler:
If Err <> 0 Then
Call ErrorManagement(funcName, Err.Description, False)
FtpExport = False
End If
End Function |
Partager