Results 1 to 2 of 2

Thread: Simple FTP Upload + getting an IP

  1. #1
    numLocked
    Guest

    Simple FTP Upload + getting an IP

    Hi, I need some help uploading a file through FTP. Let's say I want to upload a file named "ip.txt" to a server named upload.com with username and password "upload", what code would I use?

    I've been trying to do it through an Inet control set for FTP protocol using the following code:

    InetFTP.RemoteHost = "upload.com"
    InetFTP.UserName = "upload"
    InetFTP.Password = "upload"
    InetFTP.Execute , "put """ & App.Path & "/ip.txt" & """ " & "ip.txt"

    but it hasn't been working. Also, I need to do it in passive mode (to make things slightly difficult). I am more than willing to use a third party activex control also.

    Secondly, is there a good way to get the local IP address of a computer? I've been doing it through the registry, which is massively complicated. Is there a windows API call or seomthing? Thanks a lot.

  2. #2
    New Member
    Join Date
    May 2002
    Location
    Sheffield, UK
    Posts
    5

    Wink Using Inet

    Try adding a new module (eg module1.bas) and then
    declaring a Global variable within that module, eg:

    Global gblCommand as String

    Then, back to your form, set variable as follows:

    gblCommand = "PUT """ & App.Path & "/ip.txt" & """ " & "ip.txt"
    InetFTP.Execute, gblCommand

    I find this works just dandy!
    Cheers mate.
    "Like your work, love your wife."

    "He is risen!"

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