Please advise!
Matthew
No, it's not available because vbs doesn't allow "declare" statement. You
may want msinet.ocx(inetCtrl.inet) or VB wrapper of the wininet.dll. If
you're in network environment, the latter is recommanded but there is still
thread limitation.
"Matthew L. Butcher" <matthew...@vfc.com> wrote in message
news:OhUsXCyP...@tk2msftngp13.phx.gbl...
It appears that the "Microsoft Internet Transfer Control" API you mentioned
does not have a facility to upload or "put" a file using FTP.
Could you elaborate on "VB wrapper of the wininet.dll"?
Where you suggesting that a wrapper already exits or that I should write a
wrapper?
Matthew
"Han" <hp4...@kornet.net> wrote in message
news:#40UJL0P...@TK2MSFTNGP11.phx.gbl...
Looks like I spoke to soon about the ability to "put" or upload a file.
In addition to my previous questions, why do you recommend the "VB wrapper"
if in a network environment?
Matthew
"Han" <hp4...@kornet.net> wrote in message
news:#40UJL0P...@TK2MSFTNGP11.phx.gbl...
The control has "execute" method which does all the ftp commands. You may
want also "getChunk" with that. Check them in MSDN.
For wininet.dll, there may already a wheel someone made. But I don't know
about that. I've earlier used the following VB wrapper in MTS+ASP
environment without problem.
Option Explicit
Private Declare Function InternetOpen Lib "wininet.dll" Alias
"InternetOpenA" _
(ByVal lpszCallerName As String, _
ByVal dwAccessType As Long, _
ByVal lpszProxyName As String, _
ByVal lpszProxyBypass As String, _
ByVal dwFlags As Long) As Long
Private Declare Function InternetConnect Lib "wininet.dll" Alias
"InternetConnectA" _
(ByVal hInternetSession As Long, _
ByVal lpszServerName As String, _
ByVal nProxyPort As Integer, _
ByVal lpszUsername As String, _
ByVal lpszPassword As String, _
ByVal dwService As Long, _
ByVal dwFlags As Long, _
ByVal dwContext As Long) As Long
Private Declare Function InternetCloseHandle Lib "wininet.dll" _
(ByVal hInternetHandle 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
Private io, fo As Long
Public Function init1() As Boolean
io = InternetOpen("http generic", 0, vbNullString, vbNullString, 0)
If io <> 0 Then
fo = InternetConnect(io, "ftp.xxx.com", 21, "YOUR ID", "YOUR
PASSWORD", 1, 0, 0)
If fo <> 0 Then init1 = True
End If
End Function
Public Function put1(path1 as string) As Boolean
On Error GoTo exitPut
FtpPutFile fo, path1, mid(path1,instrRev(path1,"\")+1), &H1, 0
put1 = True
Exit Function
exitPut:
put1 = False
End Function
Public Sub close1()
If io <> 0 Then InternetCloseHandle io
If fo <> 0 Then InternetCloseHandle fo
End Sub
"Matthew L. Butcher" <matthew...@vfc.com> wrote in message
news:OuYwcV0P...@TK2MSFTNGP11.phx.gbl...
I attempted to create an object for "InetCtls.Inet" but I received an error
indicating that it was not licensed for use. I guess this means that your
first suggestion is a no go for VBScript.
Thanks for your input!
Matthew
"Han" <hp4...@kornet.net> wrote in message
news:O4oFDe0P...@TK2MSFTNGP11.phx.gbl...
Check this earlier thread.
http://groups.google.com/groups?as_q=license%20inetctl&safe=images&ie=UTF-8&
oe=UTF-8&lr=&hl=en
"Matthew L. Butcher" <matthew...@vfc.com> wrote in message
news:ednRCi0P...@TK2MSFTNGP10.phx.gbl...
You have not handle with the control while you have with the API.
"Matthew L. Butcher" <matthew...@vfc.com> wrote in message
news:uzcgXX0P...@TK2MSFTNGP11.phx.gbl...