|
-
Aug 2nd, 2004, 11:11 AM
#1
Thread Starter
Fanatic Member
Inet put command not working
I am trying to get my inet control to put a file from one file folder, to a backup file folder on an ftp site.
When I use the same arguments and do it manually, the file is copied to the correct file folder.
When I try to run it with my code using the inet control, no file is copied.
Can someone tell me why?
Here is my code.
VB Code:
With Menu.Inet1
.URL = strUrl
.UserName = strUser
.Password = strPass
.Execute , "cd " & strFile1
Do While Menu.Inet1.StillExecuting = True
DoEvents
Loop
.Execute , "DIR"
Do While Menu.Inet1.StillExecuting = True
DoEvents
Loop
Do
DoEvents
var_data = Menu.Inet1.GetChunk(1024, icString)
str_data = str_data & var_data
Loop Until Len(va_data) = 0
str_data = Trim(str_data)
If str_data <> "" Then
strftpfiles = Split(str_data, vbCrLf)
For i = 0 To UBound(strftpfiles)
Debug.Print strftpfiles(i)
If Left(strftpfiles(i), 6) = "D50" & strStore Then
.Execute , "PUT " & Trim(strftpfiles(i)) & " Backup\" & Trim(strftpfiles(i))
Do While Menu.Inet1.StillExecuting = True
DoEvents
Loop
End If
Next i
End If
End With
The key line of code is this:
.Execute , "PUT " & Trim(strftpfiles(i)) & " Backup\" & Trim(strftpfiles(i))
This looks like this... "Put D50002.600 Backup\D50002.600"
Thanks
-
Aug 2nd, 2004, 03:10 PM
#2
Wild guess here...
All the FTP utilities I've ever used have only accepted lowercase commands - "put" would work, "PUT" would not...
Something to do with unix background of FTP...
-
Aug 2nd, 2004, 03:17 PM
#3
Thread Starter
Fanatic Member
Thanks for the reply, but that doesn't do it. Earlier in my program GET works just fine.
I tried to make it lower case just to be sure, and it still doesn't work...
In Inet, do you have to go from FTP server to client machine, or from Client machine to FTP server? The reason I'm asking, I'm copying a file from one file folder on the FTP server, to another file folder on the same FTP server.
-
Aug 2nd, 2004, 03:56 PM
#4
I think that you
>CD to the file location
>GET filename
>CD to the backup folder, and then just
>put FileName
to upload it.
>HELP will usually list commands, and I don't recall a copy in my days of using FTP on a UNIX box
-
Aug 2nd, 2004, 04:14 PM
#5
Thread Starter
Fanatic Member
Alas, this does not work as well.
Also, I never said I was tyring to use the Copy key word and I am not using a UNIX server. The ftp site is on a Windows 2000 server.
Anyone else have any ideas?
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
|