Results 1 to 20 of 24

Thread: QFTP - Trying to "Put"

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2010
    Posts
    22
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default QFTP - Trying to "Put"

    Hey guys,

    I'm trying to upload a simple file to a FTP server, simply.

    Here's what I currently have:
    Qt Code:
    1. void PMGUI::upload()
    2. {
    3. QString fileName = QFileDialog::getOpenFileName(this, tr("Upload Task Log"), "", tr("TASK (*.task);;All Files (*)"));
    4.  
    5. QFile *file = new QFile (fileName);
    6.  
    7. QFtp *ftp = new QFtp();
    8. ftp->connectToHost("ftp.******.com");
    9. ftp->login("user", "pass");
    10.  
    11. ftp->put(file, fileName);
    12. }
    To copy to clipboard, switch view to plain text mode 

    This, doesn't work (ftp address, username, and password is correct). What am I doing wrong? Also, is there a simple way to monitor the transfer progression (via QT progress bar)?
    Last edited by Bonafide; 7th March 2010 at 04:41.

Similar Threads

  1. Replies: 3
    Last Post: 8th December 2011, 19:21
  2. Replies: 3
    Last Post: 15th February 2010, 17:27
  3. Replies: 3
    Last Post: 8th July 2008, 19:37
  4. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 19:05
  5. QFile Problem~ "Unknow error" in "open(QIODevice::ReadWrite)"
    By fengtian.we in forum Qt Programming
    Replies: 3
    Last Post: 23rd May 2007, 15:58

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
  •  
Qt is a trademark of The Qt Company.