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 ...

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?

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.

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.

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.

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.

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.

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.

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.)

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.