-
I have the following code that works:
Code:
Private Sub cmdSend_Click()
With Inet1
.Protocol = icFTP
.URL = "xxx.xxx.xxx.xxx"
.UserName = "xxx"
.Password = "xxx"
.Execute , "PUT C:\Test.txt Test.txt"
End With
End Sub
However, I have a string problem because the following code will not work:
Code:
Private Sub cmdSend_Click()
Dim strFileHost As String, strFileRemote As String
strFileHost = "C:\Test.txt"
strFileRemote = "Test.txt"
With Inet1
.Protocol = icFTP
.URL = "xxx.xxx.xxx.xxx"
.UserName = "xxx"
.Password = "xxx"
.Execute , "PUT " & strFileHost & " " & strFileRemote
End With
End Sub
I would appreciate any help. Thank you. :)
[Edited by bedowin on 08-24-2000 at 09:31 PM]
-
strFileHost and strFileRemote have not been declared. Maybe switch them with strFileName and strFileTitle?
-
That was only a mistake in the post. I edited and corrected it.
-
Maybe it's a pecularity of the .Execute method...
have you tried modifying it to:
Code:
Private Sub cmdSend_Click()
Dim strFileHost As String
Dim strFileRemote As String
Dim SendStr as String
strFileHost = "C:\Test.txt"
strFileRemote = "Test.txt"
SendStr = "PUT " & strFileHost & " " & strFileRemote
With Inet1
.Protocol = icFTP
.URL = "xxx.xxx.xxx.xxx"
.UserName = "xxx"
.Password = "xxx"
.Execute , SendStr
End With
End Sub
-
No luck.. it's very bizarre
-
Bedowin,
If the code isn't working and you are getting an error it usually helps if you actually QUOTE the error that you are getting... including all numbers and descriptions.
Without this kind of information people don't know where to look.
-
No errors GenX, it just doesn't send the file period... that's the bizarre thing... however if I replace the string variables with the actual data it works just fine. I have also tested my string variables and they return the accurate values. I believe the problem lies in how the PUT statement is constructed with string variables in place of actual values. I am looking for someone who can represent this PUT clause with string variables in a simple working manner.
-
Code:
Dim LocFile As String
Dim SerFile As String
LocFile = "C:\test.txt"
SerFile = "test.txt"
With Inet1
.Protocol = icFTP
.URL = "xxx.xxx.xxx.xxx"
.UserName = "xxx"
.Password = "xxx"
.Execute , "PUT " & LocFile & " " & SerFile
End With
Give that a hoot...
Hope that helps,
D!m
PS. Just copy and paste this code onto a form with the inet control. It SHOULD work. If not then it could be because inet is a piece made by MS so i wouldn't rely on it much.
[Edited by Dim on 08-25-2000 at 04:11 AM]
-
And, how is that code any different from my initial post on the matter?