Getting into subfolders on a FTP server

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rockybeach
    New Member
    • Dec 2011
    • 3

    Getting into subfolders on a FTP server

    I just need to get the list of files inside subfolders. I'm using the following code:

    Inet1.RemotePor t = UserPort
    FTPSITE = "ftp://" + UserName + ":" + UserPassword + "@" + txtURLbox

    Inet1.Execute FTPSITE, "DIR " '& txtNote.Text
    txtNote.Text = Inet1.GetChunk( 500000, 0)

    All I can get from this in txtNote.Text is the root directory no matter what I set txtURLbox to. How can I get deeper than the root directory?
  • BigPapaN0z
    New Member
    • Dec 2011
    • 24

    #2
    I'm assuming you are setting the variables for UserName, UserPassword and txtURLbox before calling the above code? (It may sound silly, but if the txtURLbox isn't set, it will always return the root directory since it is always null/blank.

    Second, is the & txtNote.Text supposed to be commented out? Just curious.

    It might help to post the code in it's entirety so we may see if the error is elsewhere.

    Looking forward to helping you work this out! :)

    PS - When posting code, please remember to use [ CODE ] and [ /CODE ] tags to make it easier for everyone to read. Thanks :)

    Comment

    • rockybeach
      New Member
      • Dec 2011
      • 3

      #3
      Actually I worked that one out on my own. The subfolder name needs to be added after the DIR part of the command. That works fine. Now that I am into the subfolder on a FTP server, I am unable to use GET to copy files from the subfolder to my PC. Any ideas on that?

      Comment

      • BigPapaN0z
        New Member
        • Dec 2011
        • 24

        #4
        You should be able to use "GET remote_filename .ext local_filename. ext" if you're using the same Execute command. If you wish to save the local copy somewhere specific you just need to put it as (for example) "GET filename.ext C:\Path\where\y ou\save\filenam e.ext"

        Comment

        Working...