Originally posted by bnix
Jim,
My aplogies, I was thinking that you were wanting to send a text file a http folder and I have tried doing some research since I opened my big mouth. I know it can be done, but if your Java guys/gals are wanting this done, I say place it in a text file and have them write the rest to extract it from there. Another option is to ask them how they would do it from a JScript and add a reference to the WMI Scripting Model add the JScript in a VBA module and it should run.
I will keep looking and tooling around though.
Bruce
Came across this while doing research; might be able to tweak it to meet your needs;
Public Function PutFile(ByVal LocalFileAndPath As String, ByVal _
ServerFileAndPath As String) As Boolean
Dim bRet As Boolean
Dim sFileRemote As String
Dim sDirRemote As String
Dim sFileLocal As String
Dim sTemp As String
Dim lPos As Long
Dim sError As String
On Error GoTo vbErrorHandler
'
' If not connected, raise an error!
'
If mlConnection = 0 Then
On Error GoTo 0
Err.Raise "Not connected to site", "CGFTP::PutFile", ERRNOCONNECTION
End If
bRet = FtpPutFile(mlConnection, LocalFileAndPath, ServerFileAndPath, _
1, 0)
If bRet = False Then
sError = ERRNODOWNLOAD
sError = Replace(sError, "%s", ServerFileAndPath)
On Error GoTo 0
PutFile = False
sError = sError & vbCrLf & GetINETErrorMsg(Err.LastDllError)
End If
PutFile = True
Exit Function
vbErrorHandler:
Err.Raise Err.Number, "cFTP::PutFile", Err.Description
End Function