Results 1 to 20 of 20

Thread: Putting large size file on FTP using QNetworkAccessManager

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Putting large size file on FTP using QNetworkAccessManager

    Which version of Qt are both of you guys using?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Wiki edits
    17

    Default Re: Putting large size file on FTP using QNetworkAccessManager

    Qt 4.8.2 and Qt 5.0.0Beta1 on Linux talking to a pure-ftpd server on Linux.

    I just tried Qt 4.8.0 and Qt 4.7.4 on Windows XP (in a VM on Linux, same server) with the result of about 2100 ms for the 10MB file, 20500ms for the 100MB file. FileZilla on the same machine manages to match Linux; a shade under 10 seconds for the 100MB file. On Windows 7 the performance is even worse, although I cannot see an obvious cause.

    Looking with Wireshark: both transfers from Windows are in FTP passive mode. The data packets are the same size. The pattern of outgoing data an incoming ACK packets is quite different, with Qt bunching outgoing packets more than Filezilla. QTBUG-16359 may be pertinent

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

    Default Re: Putting large size file on FTP using QNetworkAccessManager

    I also have tried with Qt 4.8.2, 4.7.4 on Windows. The transfer speed is very slow. We are also targeting to use the static libs of Qt. But firstly the transfer rate should fair enough to handle atleast 500 MB of file.
    Last edited by darshan.hardas; 4th October 2012 at 06:19.
    Darshan

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Putting large size file on FTP using QNetworkAccessManager

    Quote Originally Posted by darshan.hardas View Post
    I also have tried with Qt 4.8.2, 4.7.4 on Windows. The transfer speed is very slow. We are also targeting to use the static libs of Qt. But firstly the transfer rate should fair enough to handle atleast 500 MB of file.
    So have you launched the application that Chris posted as-is or did you somehow changed it or incorporated it in your program?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Wiki edits
    17

    Default Re: Putting large size file on FTP using QNetworkAccessManager

    To be clear, my code example is markedly slower on Windows too. I tried 4.7.4 and 4.8.0 using MingW. I have not tried MSVC to see it it is a C++ runtime issue.

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Putting large size file on FTP using QNetworkAccessManager

    Quote Originally Posted by ChrisW67 View Post
    To be clear, my code example is markedly slower on Windows too.
    But not as slow as to transfer 100MB in 11-12 minutes.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Wiki edits
    17

    Default Re: Putting large size file on FTP using QNetworkAccessManager

    No, granted. But I am working across a LAN, and the OP is not.
    Quote Originally Posted by Darshan
    For 100 Mb the time taken is approx 12 mins by QFTP/QNetworkAcessManager. But the ftp clients like FileZilla uploads the file in 3-4 mins.
    So, the "optimum" is about 3 times faster than the Qt program (500 vs 150 KB/s). This is not that dissimilar the slowdown factor I saw on a LAN connection with XP. Windows 7 was worse again.

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

    Default Re: Putting large size file on FTP using QNetworkAccessManager

    I have used the code-as is posted. Also, have implemented the logic using QFtp.

    We are testing the speed using machine instances created on cloud (Amazon EC2). The network bandwidth is very high on both the instances i.e. client and server.
    Darshan

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

    Default Re: Putting large size file on FTP using QNetworkAccessManager

    Finally I have to try using the sockets QTcpSocket and have to implemented the whole FTP RFC to transfer the file. I have managed to read the file in the separate thread and storing it in buffer to be transfered onto the connection.

    This methodology have increased the upload speed and now I can transfer the 100 MB is 3-4 minutes.

    Thank you all for giving your inputs.
    Darshan

  10. #10
    Join Date
    Oct 2013
    Posts
    1
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Putting large size file on FTP using QNetworkAccessManager

    This sounds like a lot of work, can we do something about this?

  11. #11
    Join Date
    Nov 2010
    Posts
    2
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60

    Default Re: Putting large size file on FTP using QNetworkAccessManager

    Hi, i have used your code, and get this error:

    [root@mcapro Upload]# ./Upload
    QIODevice::read: device not open
    Uploaded 0 of 0
    Finished 201

    The file exists and have size

  12. #12
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Wiki edits
    17

    Default Re: Putting large size file on FTP using QNetworkAccessManager

    The error message is clear, the file is not open. If you are using a relative path to open the file then it is likely that the current working directory of the process is not what you think it is.

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.