Results 1 to 20 of 20

Thread: Putting large size file on FTP using QNetworkAccessManager

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2007
    Posts
    39
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    3
    Thanked 1 Time in 1 Post

    Question Putting large size file on FTP using QNetworkAccessManager

    We are facing issues when we are trying to send the file (text/image/exe) to the FTP server.

    We have used QFtp functions to put the file onto the server with user authentication. But QFtp is taking huge time to upload the files. Hence we moved to QNetworkAccessManager an have used the put method for uploading.

    QNetworkAccessManager::put() returns with a reply and finished is also triggered, but no file is getting uploaded.

    I have used the below code to put:
    Qt Code:
    1. QUrl uploadurl("ftp://server/dir/");
    2. uploadurl.setUserName("XXXXXX");
    3. uploadurl.setPassword("XXXXXX");
    4. uploadurl.setPort(21);
    5. QNetworkRequest upload(uploadurl);
    6. QNetworkAccessManager *uploadman = new QNetworkAccessManager(this);
    7.  
    8. QFile* file = new QFile("filepath");
    9. if(file->open(QFile::ReadOnly)) {
    10. uploadman->put(upload, file);
    11. }
    To copy to clipboard, switch view to plain text mode 

    Please help us out with the above issue. Any example code would be a great help.

    Thanks in advance.
    Last edited by darshan.hardas; 28th September 2012 at 21:22.
    Darshan

Similar Threads

  1. Replies: 1
    Last Post: 19th March 2011, 02:42
  2. Qt displays large size jpg
    By omegas in forum Qt Programming
    Replies: 14
    Last Post: 22nd April 2010, 05:07
  3. To large exe file
    By wydesenej in forum Installation and Deployment
    Replies: 8
    Last Post: 24th January 2009, 21:44
  4. open large file in qt?
    By vishal.chauhan in forum Qt Programming
    Replies: 11
    Last Post: 29th May 2007, 07:25
  5. QLabel, large, rich text, font size
    By TheKedge in forum Qt Programming
    Replies: 3
    Last Post: 5th February 2007, 11:56

Tags for this Thread

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.