|
-
Aug 24th, 2000, 12:18 PM
#1
Thread Starter
Hyperactive Member
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]
Using VS 6 Enterprise w/ SP5 & Windows 2000 Professional
-
Aug 24th, 2000, 12:22 PM
#2
Fanatic Member
Your code:
.Execute , "PUT " & strFileName & " " & strFileLocation
Should strFileLocation be strFileTitle instead ?
-
Aug 24th, 2000, 12:24 PM
#3
Thread Starter
Hyperactive Member
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
Using VS 6 Enterprise w/ SP5 & Windows 2000 Professional
-
Aug 24th, 2000, 12:33 PM
#4
Fanatic Member
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]
-
Aug 24th, 2000, 12:36 PM
#5
Thread Starter
Hyperactive Member
No, that returns a syntax Error.
Using VS 6 Enterprise w/ SP5 & Windows 2000 Professional
-
Aug 24th, 2000, 12:38 PM
#6
Fanatic Member
I left off the last "&" in my original post. Do you still get a syntax error with the correction ?
-
Aug 24th, 2000, 01:04 PM
#7
Thread Starter
Hyperactive Member
No, but now it just doesn't do anything all over again... It just sits there...
Using VS 6 Enterprise w/ SP5 & Windows 2000 Professional
-
Aug 24th, 2000, 01:35 PM
#8
Thread Starter
Hyperactive Member
Hello.. is anyone still out there?
Using VS 6 Enterprise w/ SP5 & Windows 2000 Professional
-
Aug 24th, 2000, 01:39 PM
#9
Fanatic Member
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 ?
-
Aug 24th, 2000, 02:01 PM
#10
Thread Starter
Hyperactive Member
Could you send me the sample code you used that worked? [email protected]
Thanks!
Using VS 6 Enterprise w/ SP5 & Windows 2000 Professional
-
Aug 24th, 2000, 02:11 PM
#11
Thread Starter
Hyperactive Member
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.
Using VS 6 Enterprise w/ SP5 & Windows 2000 Professional
-
Aug 24th, 2000, 02:43 PM
#12
Thread Starter
Hyperactive Member
I cannot believe no one has encountered this problem before... (
Using VS 6 Enterprise w/ SP5 & Windows 2000 Professional
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|