Skip to content

Ceytrain/FTP-Client-With-QTcpSocket

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Qt6-FTP-Client-APIs-For-vsftpd

中文 | English

简介

用Qt6写的针对vsftpd的FTP客户端APIs

目前支持的功能

  • PASV模式
  • GET
  • LIST

如何使用

    #include "Qt6Ftp.h"

    Qt6Ftp ftp;
    QString respond;

    respond=ftp.connectToFtpServer("192.168.52.142",21);
    qDebug()<<respond;

    respond=ftp.user("ftpuser");
    qDebug()<<respond;

    respond=ftp.password("ubuntu");
    qDebug()<<respond;

    std::vector<std::string> items;
    respond=ftp.list(items);
    qDebug()<<respond;
    for(auto elem:items){
        qDebug()<<elem.c_str();
    }

    QString fileContent;
    respond=ftp.get("003.txt",fileContent);
    qDebug()<<respond;
    qDebug()<<fileContent;

    respond=ftp.list(items);
    qDebug()<<respond;
    for(auto elem:items){
        qDebug()<<elem.c_str();
    }

    ftp.close();

image

About

Qt6 dropped support for FTP and provided a scxml solution, but you can still use the simple QTcpSocket way to connect to the FTP server and download files

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • C++ 100.0%