-
Mobile FTP
Hi! I'm trying to send a SQLCe file form my WM6 phone to an ftp server. I'm getting a "NotSupportedException" error. I can't figure out what im doing wrong.
Any ideas!? thanks!
Code:
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
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 FtpGetFile Lib "wininet.dll" Alias "FtpGetFileA" _
(ByVal hFtpSession As Long, ByVal lpszRemoteFile As String, _
ByVal lpszNewFile As String, ByVal fFailIfExists As Boolean, _
ByVal dwFlagsAndAttributes As Long, ByVal dwFlags As Long, _
ByVal dwContext As Long) As Boolean
Private Declare Function FtpPutFile Lib "wininet.dll" Alias "FtpPutFileA" _
(ByVal hFtpSession As Long, ByVal lpszLocalFile As String, _
ByVal lpszRemoteFile As String, ByVal dwFlags As Long, _
ByVal dwContext As Long) As Boolean
Public Sub UploadFile()
Dim lngINetConn
Dim lngINet
Dim blnrc
lngINet = InternetOpen("MyFTP Control", 1, vbNullString, vbNullString, 0)
'error happens before this point
lngINetConn = InternetConnect(lngINet, "Server", 0, _
"UN", "PW", 1, 0, 0)
blnrc = FtpGetFile(lngINetConn, "localfile", "FTPfile", 0, 0, 1, 0)
End Sub
Public Sub DownloadFile()
Dim lngINetConn
Dim lngINet
Dim blnrc
lngINet = InternetOpen("MyFTP Control", 1, vbNullString, vbNullString, 0)
lngINetConn = InternetConnect(lngINet, "Server", 0, _
"UN", "PW", 1, 0, 0)
blnrc = FtpPutFile(lngINetConn, "localfile", "FTPfile", 1, 0)
End Sub
-
Re: Mobile FTP
Where did you get those declarations from - they don't look right.
They look as though they may be eVB, as I am pretty sure the 'long' shoud be 'integer'
Declare Function InternetOpen Lib "wininet.dll" Alias "InternetOpenA" (ByVal
sAgent As String, ByVal lAccessType As Integer, ByVal sProxyName As String,
ByVal sProxyBypass As String, ByVal lFlags As Integer) As Integer
There is a sample here by Sergey Bogdanov which may help
-
Re: Mobile FTP
I shoulda saw that one..Changing the Long to Integer got rid of that error. Now my InternetConnect is returning a 0. How can i find out what the exact problem for this was? I'm assuming there is some issue with connecting to the server.
I did also try that sample but i get a "Error: 12029" Not sure what that means
-
Re: Mobile FTP
From searching google - it would appear to be an 'activesync' problem - try it over GPRS/3G