I have a piece of code that uses wininet control to ftp a file from
within Access xP. I want to replace the wininet with the winhttp
control. (end users computer doesnt like the wininet control for some
reason, and besides i already use the winhttp for other things in that
program. seems daft using two different internet controls).
The code is as follows:
Function UploadFile(ByVal HostName As String, _
ByVal username As String, _
ByVal password As String, _
ByVal LocalFileName As String, _
ByVal RemoteFileName As String) As Boolean
Dim ftp As Inet
Set ftp = New Inet
With ftp
.Protocol = icFTP
.RemoteHost = HostName
.username = username
.password = password
.Execute .URL, "Put " + LocalFileName + " " + RemoteFileName
Do While .StillExecuting
DoEvents
Loop
UploadFile = (.ResponseCode = 0)
End With
Set ftp = Nothing
End Function
Any suggestions? |