Error qftp:: get



  • i have written the code for receiving the file(image file) using qftp
    when am compiling am getting the below error
    @
    this is the code for receiving the image file using QFtp

    QFile file;
    // file = new QFile("a_30.bmp");
    QString str = "a_30.bmp";
    QFtp *ftp;
    ftp = new QFtp(this);
    int i=ftp->get("a_30.bmp",QIODevice::ReadWrite,QFtp::Binary);

    @

    error is

    no matching function for a call QFtp::get(QString *,QIODevice::openModeFlag,QFtp::TransferType)

    /usr/include/QTNetwork/qftp.h : note: candidates are int(QFtp::get(const QString &,QIODevice *, QFtp::TransferType)


  • Moderators

    As a second parameter you are proving a QIODevice flag and not a pointer to a QIODevice. "Checkout the QFtp documentation.":http://qt-project.org/doc/qt-4.8/qftp.html#get



  • i vll definetly check the QFtp documentation and come back to u

    but i have a doubt

    after sending a file using Qftp from sender side. the receiver will get that file in the home directory

    but how the receiving side application should identify that particular .jpg file has come to its system

    actually my receiving application functionality is to receive the file(image file) and display it on the label.
    am able to receive the file sent by qftp but without hardcoding the filename in the program how should i know the filename for displaying

    please help me it is a bit urgent

    thanking u


  • Moderators

    In general, you should start a new thread, if you have a new question. This new thread's shall reflect a very brief summary of your issue.

    As indicated in the docs QFtp is an implementation of an FTP client. AFAIK it is working as traditional FTP clients. At least that reflects my experience. It has several "command line" commands as you know from linux and windows shells. So, if you like to get the file some place else, you need to navigate to this place and send the file. Checkout "mkdir,":http://qt-project.org/doc/qt-4.8/qftp.html#mkdir http://qt-project.org/doc/qt-4.8/qftp.html#cd and the other stuff.

    Note: QFtp is deprecated and is no longer directly available in Qt5


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.