Results 1 to 5 of 5

Thread: Inet put command not working

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2001
    Location
    Indiana
    Posts
    612

    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:
    1. With Menu.Inet1
    2.         .URL = strUrl
    3.         .UserName = strUser
    4.         .Password = strPass
    5.         .Execute , "cd " & strFile1
    6.         Do While Menu.Inet1.StillExecuting = True
    7.             DoEvents
    8.         Loop
    9.         .Execute , "DIR"
    10.         Do While Menu.Inet1.StillExecuting = True
    11.             DoEvents
    12.         Loop
    13.         Do
    14.             DoEvents
    15.             var_data = Menu.Inet1.GetChunk(1024, icString)
    16.             str_data = str_data & var_data
    17.         Loop Until Len(va_data) = 0
    18.         str_data = Trim(str_data)
    19.         If str_data <> "" Then
    20.             strftpfiles = Split(str_data, vbCrLf)
    21.             For i = 0 To UBound(strftpfiles)
    22.                 Debug.Print strftpfiles(i)
    23.                 If Left(strftpfiles(i), 6) = "D50" & strStore Then
    24.                     .Execute , "PUT " & Trim(strftpfiles(i)) & " Backup\" & Trim(strftpfiles(i))
    25.                     Do While Menu.Inet1.StillExecuting = True
    26.                         DoEvents
    27.                     Loop
    28.                 End If
    29.             Next i
    30.         End If
    31.     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
    David Wilhelm

  2. #2
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263
    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...

  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2001
    Location
    Indiana
    Posts
    612
    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.
    David Wilhelm

  4. #4
    Banned dglienna's Avatar
    Join Date
    Jun 2004
    Location
    Center of it all
    Posts
    17,901
    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

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2001
    Location
    Indiana
    Posts
    612
    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?
    David Wilhelm

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width