Code Monkey home page Code Monkey logo

fineftp-server's Introduction

Windows Ubuntu macOS

fineFTP Server

FineFTP is a minimal FTP server library for Windows and Unix flavors. The project is CMake based and only depends on asio, which is integrated as git submodule. No boost is required.

You can easily embed this library into your own project in order to create an embedded FTP Server. It was developed and tested on Windows 10 (Visual Studio 2015 / 2019, MinGW) and Ubuntu 16.04 - 21.10 (gcc 5.4.0 - 11.2.0).

Features

  • FTP Passive mode (the only mode you need nowadays)
  • Listing directories
  • Uploading and downloading files
  • Creating and removing files and directories
  • User authentication (and anonymous user without authentication)
  • Individual local home path for each user
  • Access control on a per-user-basis
  • UTF8 support (On Windows MSVC only)

fineFTP does not support any kind of encryption. You should only use fineFTP in trusted networks.

Example

Using fineFTP in your application is simple. Just create an FtpServer object, add one or multiple users and start the server.

#include <fineftp/server.h>
#include <thread>
 
int main() {
  // Create an FTP Server on port 2121. We use 2121 instead of the default port
  // 21, as your application would need root privileges to open port 21.
  fineftp::FtpServer ftp_server(2121);
 
  // Add the well known anonymous user. Clients can log in using username
  // "anonymous" or "ftp" with any password. The user will be able to access
  // your C:\ drive and upload, download, create or delete files. On Linux just
  // replace "C:\\" with any valid path. FineFTP is designed to be cross-platform.
  ftp_server.addUserAnonymous("C:\\", fineftp::Permission::All);
  
  // Start the FTP Server with a thread-pool size of 4.
  ftp_server.start(4);
 
  // Prevent the application from exiting immediately
  for (;;) std::this_thread::sleep_for(std::chrono::milliseconds(100));
  return 0;
}

How to checkout and build

There is an example project provided that will create an FTP Server at C:\ (Windows) or / (Unix).

  1. Install cmake and git / git-for-windows

  2. Checkout this repo and the asio submodule

    git clone https://github.com/eclipse-ecal/fineftp-server.git
    cd fineftp-server
    git submodule init
    git submodule update
  3. CMake the project (Building as debug will add some debug output that is helpful so see if everything is working)

    mkdir _build
    cd _build
    cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=_install
  4. Build the project

    • Linux: make
    • Windows: Open _build\fineftp.sln with Visual Studio and build the example project
  5. Start fineftp_example / fineftp_example.exe and connect with your favorite FTP Client (e.g. FileZilla) on port 2121 (This port is used so you don't need root privileges to start the FTP server)

Contribute

Awesome, you want to contribute to FineFTP? Here is how you can do that!

  • Leave us a star โญ๏ธ (That's GitHub money!)
  • Create an issue and write about a feature you would like or a bug you have found (maybe we will find some spare time to implement it ๐Ÿ˜‰)
  • Fork this repository, implement the feature yourself and create a pull request

fineftp-server's People

Contributors

florianreimold avatar cherbie avatar piponazo avatar marekknapek avatar blutkoete avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.