Create an FTP Server

This is a discussion on Create an FTP Server within the Networking/Device Communication forums, part of the General Programming Boards category; Hello, I've done a search on this but couldn't find something too useful (maybe I just searched for the wrong ...

  1. #1
    Epo
    Epo is offline
    Registered User
    Join Date
    Jun 2003
    Posts
    361

    Create an FTP Server

    Hello, I've done a search on this but couldn't find something too useful (maybe I just searched for the wrong things) but either way, I'm here now

    My questions is, there are programs out there such as Serv-U, Bulletproof, and what not that turn your computer into a FTP Server and people can connect to it (even through Internet Explorer).

    I was hoping somebody could clear up what's needed for a program like this (I'm looking to make my own), and what do I need to look into (Winsock?).

    Thanks for any input

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,849
    Sure, all you need to do is implement the server side of this
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  3. #3
    Epo
    Epo is offline
    Registered User
    Join Date
    Jun 2003
    Posts
    361
    So you could have just said "No I can't help you" or, better yet, not have said anything at all.

  4. #4
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    Originally posted by Epo
    So you could have just said "No I can't help you" or, better yet, not have said anything at all.
    Salem answered your question fair and square. If it wasn't the answer you expected, it's probably because you didn't ask the right question. Don't knock people that give you help, you'll only end up loosing out.

    Do you know what Salem's link points to? It's the RFC for FTP, which is basically the bible for the FTP protocol. Implementing a server side application to accomodate this RFC is what's needed to create an FTP server. There, maybe now you see that Salem was helping you after all, eh?
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  5. #5
    Epo
    Epo is offline
    Registered User
    Join Date
    Jun 2003
    Posts
    361
    If you go into "Learn Greek 101" and the prof wants you to read an essay about the Social Inequalities of Democratic Societies...in Greek...and 70 pages long...then, based on that write about the Social Equalities of Democratic Societies, using the initial essay for proof, and write it in Greek...you can't help but feel a bit of contempt.

    But, my bad, Salem, I apologise, there's probably more to your post than I saw the first time around, and I'll check it out again.

    I just want to say though, I DID put effort into it before responding. After 20 pages of the article I didn't see one line of C++ code.

    And I guess that may be my fault, as Hammer suggested I probably didn't ask the right question.

    Is there some step down area I could start at before tackling this article? I mean, I don't even know how to open up my I.P. to the internet world with C++, and the article (so far) seemed more of theory, than something that (on it's own) would teach me to create an FTP server out of my computer.

    I'll take a look at it again though.

    Edit: Bad wording. "open up my I.P. to the internet world with C++" WOULD be an "FTP Server", so, yeah, bad choice of words. Just meant to say I'm pretty clueless on even the first line of code I would need to write down.
    Last edited by Epo; 01-11-2004 at 07:45 PM.

  6. #6
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    Windows or Unix ? There's some tutorial links in a thread at the top of this forum.

    Beej's guide is a good opener for sockets(). It has code snippets, and a full application (both client and server). It won't teach you FTP, but at least you can see how two PCs talk over IP to each other.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  7. #7
    'AlHamdulillah
    Join Date
    Feb 2003
    Posts
    790
    If you go into "Learn Greek 101" and the prof wants you to read an essay about the Social Inequalities of Democratic Societies...in Greek...and 70 pages long...then, based on that write about the Social Equalities of Democratic Societies, using the initial essay for proof, and write it in Greek...you can't help but feel a bit of contempt.
    I just want to say though, I DID put effort into it before responding. After 20 pages of the article I didn't see one line of C++ code.
    the thing is, that in both cases, it is relatively easy if you know the language. YOU should be able to comprehend and translate what you learn from there into code, not expect people to always hand it to you.

  8. #8
    Registered User
    Join Date
    Jan 2004
    Posts
    26
    Originally posted by EvBladeRunnervE
    the thing is, that in both cases, it is relatively easy if you know the language. YOU should be able to comprehend and translate what you learn from there into code, not expect people to always hand it to you.
    Bingo. That document on FTP is basically the FTP bible. FTP is but a solution to a problem (how to transfer files and such), it's up to the programmer to implement that solution using his preferred tools (language).

    I don't mean to sound like one of the "RTFM n00bs suxx0rz" type, but perhapse you're raising the bar a bit too high for yourself here? Implementing a communications standard isn't exactly something you want to do unless you have quite a bit of experience with network programming. Since you're asking if you need to use winsock or not then maybe you should try something a little simpler?

    If you're trying to learn how to muck with networks then here's my suggestion: Program a version of Unix's wget for DOS. wget is a program that downloads a file from the commandline. I.E.

    wget http://www.server.com/path/to/file.tar.gz

    An example of it's output:

    Code:
    12:33:31 ~> wget cboard.cprogramming.com/newreply.php
    --12:33:57--  http://cboard.cprogramming.com/newreply.php
               => `newreply.php'
    Connecting to cboard.cprogramming.com:80... connected!
    HTTP request sent, awaiting response... 200 OK
    Length: 6,424 [text/html]
    
        0K ......                                                100% @   7.21 KB/s
    
    12:34:03 (7.21 KB/s) - `newreply.php' saved [6424/6424]
    Once that's done you should have enough of a clue to know where to go from there. Not to be a dick, but I seriously believe that you should take on something a bit simpler before you start coding a freakin' FTP server.

    Oh, and there are FTP servers for windows on Sourceforge if you want to look at some source, btw.

  9. #9
    Epo
    Epo is offline
    Registered User
    Join Date
    Jun 2003
    Posts
    361
    Hammer:
    I'm hoping for a windows application by the time I'm done.

    I'll check out BJee's tutorials on sockets before tackling the task of converting that document to code. As I said, I guess I asked the wrong question the first time around, but tutorials on how to even start I.P. communication is what I was looking for.

    Salem:
    Thanks for the reference as to how FTPs work. I'll look into it more deeply once I learn more from the above tutorials.

    EvBladeRunnervE:
    My post was an attempt to learn how to comprehend FTPs and the process needed behind them. I was not looking for someone to write the program and hand it to me.

    JLPence:
    No offence taken, but I personally find the best way I can learn to program is to take on a project that's way bigger than me, and learn it as I go along (it's worked for me so far). Thanks for the Sourceforge pointer.

    Thanks for the help.

  10. #10
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    ... and just in case you missed it:
    Useful Links And Good Books

    Have fun

    Post more questions here whenever you're ready, and someone will help.
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  11. #11
    'AlHamdulillah
    Join Date
    Feb 2003
    Posts
    790
    No offence taken, but I personally find the best way I can learn to program is to take on a project that's way bigger than me, and learn it as I go along (it's worked for me so far). Thanks for the Sourceforge pointer.
    should of made sure to make that clear. But are you really able to learn from a large project when you cannot translate what amounts to fairly simple smaller tasks into a program? I am not saying you should go back to "Hello world" level apps, I am just saying that I believe you should have a solid foundation in Network programming with winsock before you approach an FTP server project. After all, one cannot just start a graphics engine without knowing something of the underlying features(i.e. the API, including how the API handles Matrices,etc.)

  12. #12
    Registered User
    Join Date
    Jan 2004
    Posts
    37
    Get Richard Stephens' book on Network Programming. It is really comprehensive and starts from the ground up. You will find it very interesting and see some great code on how to get the time from a server and how to sniff packets on your network. I would go buy it if you are really interested in network programming. You will have to massage the code in the book a bit to get it to work in windows, but not too much. Once you write your first date-time client, you will understand the RFC for FTP much better.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Multiple clients to "internet" server
    By Zarniwoop in forum C Programming
    Replies: 2
    Last Post: 10-12-2008, 12:04 AM
  2. TCP/IP client & echo server
    By Jordban in forum C++ Programming
    Replies: 2
    Last Post: 06-06-2005, 07:39 PM
  3. Unicode vurses Non Unicode client server application with winsock2 query?
    By dp_76 in forum Networking/Device Communication
    Replies: 0
    Last Post: 05-16-2005, 08:26 AM
  4. SMTP Server Not Working
    By (TNT) in forum Networking/Device Communication
    Replies: 1
    Last Post: 07-15-2003, 06:33 AM
  5. Web Server in Router Network...
    By Aidman in forum Tech Board
    Replies: 15
    Last Post: 01-17-2003, 10:24 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21