Results 1 to 14 of 14

Thread: [RESOLVED] FTP Logon Issue

Threaded View

  1. #1

    Thread Starter
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Resolved [RESOLVED] FTP Logon Issue

    Using the Internet and FTP APIs I am opening a ftp connection and logging into a site but it doesnt work when done via code so I tried manually. I get this dialog error...

    What is the issue?


    VB Code:
    1. Private Sub TransmitMe()
    2.     Dim hConnection As Long
    3.     Dim hOpen As Long
    4.     Dim sOrgPath   As String
    5.     Dim lRet As Long
    6.     'open an internet connection
    7.     hOpen = InternetOpen("Test", INTERNET_OPEN_TYPE_PRECONFIG, vbNullString, vbNullString, 0)
    8.     'connect to the FTP server
    9.     hConnection = InternetConnect(hOpen, "subdomain.example.com", INTERNET_DEFAULT_FTP_PORT, "VB-Guru", "Meow", INTERNET_SERVICE_FTP, IIf(PassiveConnection, INTERNET_FLAG_PASSIVE, 0), 0)
    10.     'create a buffer to store the original directory
    11.     sOrgPath = String(MAX_PATH, 0)
    12.     'get the directory
    13.     FtpGetCurrentDirectory hConnection, sOrgPath, Len(sOrgPath)
    14.     'set the current directory to 'root/Incoming
    15.     FtpSetCurrentDirectory hConnection, "Incoming"
    16.     'upload the file 'test.htm'
    17.     lRet = FtpPutFile(hConnection, ByVal "C:\Test.txt", "Test.txt", FTP_TRANSFER_TYPE_BINARY, 0)
    18.     If lRet = 1 Then
    19.         '
    20.     Else
    21.         '
    22.     End If
    23.     'close the FTP connection
    24.     InternetCloseHandle hConnection
    25.     'close the internet connection
    26.     InternetCloseHandle hOpen
    27. End Sub
    Attached Images Attached Images  
    Last edited by RobDog888; Jun 1st, 2006 at 01:03 AM.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

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