Results 1 to 4 of 4

Thread: Help on QFtp

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2016
    Posts
    2
    Qt products
    Qt4
    Platforms
    Windows

    Default Help on QFtp

    Hi i all
    i am a new user of QT i have a problem.
    I connect to a ftp server using QFTP all work i need to put a file on this server.

    ftp is a global variable when a call myroutine is loggedin on server.

    i have connect this Signal to my slot:
    Qt Code:
    1. connect(ftp,SIGNAL(done(bool)),this,SLOT(chkstat(bool)));
    2. connect(ftp,SIGNAL(commandFinished(int,bool)),this,SLOT(CmdFinishSlot()));
    3. connect(ftp,SIGNAL(commandStarted(int)),this,SLOT(CmdStartSlot()));
    4. connect(ftp,SIGNAL(dataTransferProgress(qint64,qint64)),this,SLOT(ftpProgress(qint64,qint64)));
    To copy to clipboard, switch view to plain text mode 


    When i try to execute the routine to put a file

    Qt Code:
    1. void myroutine (QDir LDirToPut,QString RemoteDir)
    2. {
    3. QFileInfo FileList;
    4. QByteArray buffer;
    5.  
    6.  
    7. ftp->cd(RemoteDir);
    8.  
    9. foreach (FileList, LDirToPut.entryInfoList())
    10. {
    11. qDebug()<< FileList.fileName();
    12.  
    13. if(FileList.isFile())
    14. {
    15. CmdFinish=false;
    16. QFile *file = new QFile(FileList.fileName());
    17. file->open(QIODevice::ReadOnly);
    18. buffer=file->readAll();
    19. buffer=buffer.toBase64();
    20. ftp->put(buffer,FileList.fileName(),QFtp::Binary);
    21. while(CmdFinish){};
    22. file->close();
    23. };
    24.  
    25. };
    26. }
    To copy to clipboard, switch view to plain text mode 


    i dont recive any signal and i put a 0 k byte file on server.The signal startcommand, finishcommeand and progress( with 0 byte in done and total) are recived by slot only when i finish the myroutyne.

    Any help
    Thanks

    Sorry for my english
    Last edited by anda_skoa; 21st June 2016 at 11:46. Reason: missing [code] tags

Similar Threads

  1. QFTP in LINUX
    By jsmith in forum Qt Programming
    Replies: 1
    Last Post: 2nd December 2009, 07:00
  2. Synchronous QFtp?
    By aarpon in forum Qt Programming
    Replies: 2
    Last Post: 26th October 2009, 09:28
  3. QFtp over QHttp
    By parusri in forum Qt Programming
    Replies: 1
    Last Post: 19th January 2009, 19:16
  4. Synchronizing QFtp
    By arun_vj in forum Qt Programming
    Replies: 0
    Last Post: 5th November 2008, 12:31
  5. Replies: 0
    Last Post: 23rd September 2007, 11:54

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.