-
I am trying the following code, but it will not send the File:
Code:
Private Sub cmdSend_Click()
Dim strFileName As String, strFileTitle As String
strFileName = CommonDialog1.FileName
strFileTitle = CommonDialog1.FileTitle
With Inet1
.Protocol = icFTP
.URL = "xxx.xxx.xxx.xxx"
.UserName = "xxx"
.Password = "xxx"
.Execute , "PUT " & strFileName & " " & strFileTitle
End With
End Sub
x = unique address, username, password
*If I forget the string variables and just type the text into the code of where it should go then it works fine.
Can someone please help?
[Edited by bedowin on 08-24-2000 at 01:25 PM]
-
Your code:
.Execute , "PUT " & strFileName & " " & strFileLocation
Should strFileLocation be strFileTitle instead ?
-
Sorry, that was just a mistype... it really is...
Code:
Private Sub cmdSend_Click()
Dim strFileName As String, strFileTitle As String
strFileName = CommonDialog1.FileName
strFileTitle = CommonDialog1.FileTitle
With Inet1
.Protocol = icFTP
.URL = "xxx.xxx.xxx.xxx"
.UserName = "xxx"
.Password = "xxx"
.Execute , "PUT " & strFileName & " " & strFileTitle
End With
End Sub
-
Might try the following:
.Execute , "PUT " & "'" & strFileName & "'" & " " & "'" & strFileTitle & "'"
Hard to see, but that is placing a single quote within double quotes before and after the string variable.
You can probably combine some of that together so you will not have so many "&" signs, but the general idea is to quote your strings within the command.
[Edited by jbart on 08-24-2000 at 01:37 PM]
-
No, that returns a syntax Error.
-
I left off the last "&" in my original post. Do you still get a syntax error with the correction ?
-
No, but now it just doesn't do anything all over again... It just sits there...
-
Hello.. is anyone still out there?
-
Just me. I cannot think of anything else to try. I experienced the same problem you are having, but placing the quotes around the string variables solved it for me.
Anyone else have ideas ?
-
Could you send me the sample code you used that worked? [email protected]
Thanks!
-
This works:
Code:
Private Sub cmdSend_Click()
Dim strFileName As String, strFileTitle As String
strFileName = CommonDialog1.FileName
strFileTitle = CommonDialog1.FileTitle
With Inet1
.Protocol = icFTP
.URL = "xxx.xxx.xxx.xxx"
.UserName = "xxx"
.Password = "xxx"
.Execute , "PUT C:\Test.txt Test.txt"
End With
End Sub
But this does not:
Code:
Private Sub cmdSend_Click()
With Inet1
.Protocol = icFTP
.URL = "xxx.xxx.xxx.xxx"
.UserName = "xxx"
.Password = "xxx"
.Execute , "PUT " & strFileName & " " & strFileTitle
End With
End Sub
And, again I've tested to see if the variables are turning up the right information and they are.
-
I cannot believe no one has encountered this problem before... :o(