Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. FTP programming using Winsock. Possible?

FTP programming using Winsock. Possible?

Scheduled Pinned Locked Moved C / C++ / MFC
c++sysadminhelptutorialquestion
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    mineus55
    wrote on last edited by
    #1

    First of all, I'm not even sure if the topic makes sense. I'm using native C++ compiler (Dev-C++). Anyway, I'm new to network programming and have been doing little project on network communication between two computers using WinSock (just sending and receiving string). And then I just had an idea whether this kind of "communication" will also work for FTP servers. I tried it on an ftp server on port 21. I requested connection and, to my surprise, I received a welcome message from it. But then I have no clue how to send commands/requests at all (USER or PASS). I would assume the problem is either I don't have the correct string format, or the socket type is just different (I don't have any clue about network types very much). Or maybe Winsock is just not meant for it? Please advise me on what's actually going on. I know there are alot of free libraries out there, but I want to know what's actually happening behind it, in terms of protocols. Thanks! PS: Not sure if this belongs to the correct board, but move it as you wish. Andrew

    M 1 Reply Last reply
    0
    • M mineus55

      First of all, I'm not even sure if the topic makes sense. I'm using native C++ compiler (Dev-C++). Anyway, I'm new to network programming and have been doing little project on network communication between two computers using WinSock (just sending and receiving string). And then I just had an idea whether this kind of "communication" will also work for FTP servers. I tried it on an ftp server on port 21. I requested connection and, to my surprise, I received a welcome message from it. But then I have no clue how to send commands/requests at all (USER or PASS). I would assume the problem is either I don't have the correct string format, or the socket type is just different (I don't have any clue about network types very much). Or maybe Winsock is just not meant for it? Please advise me on what's actually going on. I know there are alot of free libraries out there, but I want to know what's actually happening behind it, in terms of protocols. Thanks! PS: Not sure if this belongs to the correct board, but move it as you wish. Andrew

      M Offline
      M Offline
      Mark Salsbery
      wrote on last edited by
      #2

      Very possible. You're on the right track: it's all about the protocol - what sequence of bytes to send and receive and when to do it. A Google search on "FTP protocol" will get you links to more than you ever wanted to know about FTP. It's been around for a long time :) I think this is the official specification: FILE TRANSFER PROTOCOL (FTP)[^] Mark

      M 1 Reply Last reply
      0
      • M Mark Salsbery

        Very possible. You're on the right track: it's all about the protocol - what sequence of bytes to send and receive and when to do it. A Google search on "FTP protocol" will get you links to more than you ever wanted to know about FTP. It's been around for a long time :) I think this is the official specification: FILE TRANSFER PROTOCOL (FTP)[^] Mark

        M Offline
        M Offline
        mineus55
        wrote on last edited by
        #3

        Thanks, Mark! You encouraged me to find the problem why my "USER YYYY" does not produce any reply. It turns out I had the wrong CRLF closing bytes. Now at least I can do USER and PASS. =) It's getting more interesting. Thanks! Andrew

        K 1 Reply Last reply
        0
        • M mineus55

          Thanks, Mark! You encouraged me to find the problem why my "USER YYYY" does not produce any reply. It turns out I had the wrong CRLF closing bytes. Now at least I can do USER and PASS. =) It's getting more interesting. Thanks! Andrew

          K Offline
          K Offline
          kristmun
          wrote on last edited by
          #4

          Just remember Andrew that you need at least two channels, one to issue the commands and one to transfer the data. Good luck! /krissi

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups