hvorfor virker min upload funktion ikke??
Koden er nedenunder! Der er ikke desideret fejl i koden da jeg godt kan uploade små txtfiler på omkring 20 kb men når jeg vil uploade en .mdb fil på 200 kb gider den ikke og filen kommer ikke op!nogen ideer til hvad jeg har gjort forkert eller mangler??
'API kald:
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 "wininet.dll" Alias "InternetOpenA" (ByVal sAgent As String, ByVal lAccessType As Long, ByVal sProxyName As String, ByVal sProxyBypass As String, ByVal lFlags As Long) As Long
Const FTP_TRANSFER_TYPE_UNKNOWN = &H0
Const INTERNET_DEFAULT_FTP_PORT = 21
Const INTERNET_OPEN_TYPE_PRECONFIG = 0
Const INTERNET_SERVICE_FTP = 1
Const INTERNET_FLAG_PASSIVE = &H8000000
'Uploadfunktionen:
Dim hConnection As Long, hOpen As Long
Dim sFile As String
'open an internet connection
hOpen = InternetOpen("Any-Key Regnskab", INTERNET_OPEN_TYPE_PRECONFIG, vbNullString, vbNullString, 0)
'connect to the FTP server
hConnection = InternetConnect(hOpen, "*******", INTERNET_DEFAULT_FTP_PORT, "t*ec***r.dk", "*******", INTERNET_SERVICE_FTP, IIf(PassiveConnection, INTERNET_FLAG_PASSIVE, 0), 0)
sFile = App.Path & "\Regnskab.mdb"
MsgBox sFile
FtpPutFile hConnection, sFile, "/******/********/www/*******/Database/Regnskab.mdb", FTP_TRANSFER_TYPE_UNKNOWN, 0
På forhånd tak!