Results 1 to 10 of 10

Thread: how to transmission a big file use the QtNetwork

  1. #1
    Join Date
    Feb 2007
    Posts
    71
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Question how to transmission a big file use the QtNetwork

    how to transmission a big file use the QtNetwork

    I hope use the tcp protocol.a computer(IP) send a file to another computer(IP).



    who can give me an example(a file transmission program). my E-mail: fengtian.we@gmail.com

    thanks.....

    and I hope can get the progress and speed for display to user.
    Last edited by fengtian.we; 25th March 2007 at 15:14.

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

    Default Re: how to transmission a big file use the QtNetwork

    Could you provide some details? What protocol do you want to use?

  3. #3
    Join Date
    Sep 2006
    Posts
    68
    Thanks
    15
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: how to transmission a big file use the QtNetwork

    As Wysota said, do you have any idea which protocol you want to use?

    Without one, a very basic program could transfer files by using a QSocket and writeBlock at the end sending the file, and readBlock at the end receiving the file.

    Check the docs for QSocket, its actually quite straight forward.

    As for speed and progress bar.. speed is easy, as you know how many bytes you have sent / received, so just divide by seconds. For a progress bar your sending program would need to let the receiving program know in advance how many bytes to expect, which could also be done with a QSocket.

    Sorry, don't have time to give you a full example now, but if you read the docs, you will most likely figure it out.

  4. #4
    Join Date
    Feb 2007
    Posts
    71
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Question Re: how to transmission a big file use the QtNetwork

    HA~ thank you, I want konw which Method can transmission file ,how to get a speed of Current .

    OH~ God I can't do more Description, why I am chinese~~

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

    Default Re: how to transmission a big file use the QtNetwork

    But what protocol? Do you have any requirements? TCP, UDP, doesn't matter? What about higher layers? TFTP, FTP, HTTP?

  6. #6
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: how to transmission a big file use the QtNetwork

    Well, for file transfer, I think FTP is the way to go.

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

    Default Re: how to transmission a big file use the QtNetwork

    The problem is you'd have to implement an ftp server on one side, if you don't have it there.

  8. #8
    Join Date
    Feb 2007
    Posts
    71
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Question Re: how to transmission a big file use the QtNetwork

    I'm so sorry,wysota. I chanage My Thread text,but not tell you~

    I want to use the TCP protocol

    I think is one-file to one-IP,may be the TCP is better~

    How about the FTP????

    Can I use it transfers a file and it can give me some info(e.g. speed ,progress.... )

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

    Default Re: how to transmission a big file use the QtNetwork

    But do you want to use your own custom protocol OVER tcp or use some standard one (http, ftp...) ? If the latter, then you need to have a server implemented. If the former then December has already given you the answer.

  10. #10
    Join Date
    Feb 2007
    Posts
    71
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11

    Default Re: how to transmission a big file use the QtNetwork

    Ok I think I shoud try a Dome Progream first~

Similar Threads

  1. Draging a non-existing file to the Windows Desktop
    By klaus1111 in forum Qt Programming
    Replies: 13
    Last Post: 20th September 2007, 11:47
  2. Sending Binary File with QFTP
    By nbkhwjm in forum Newbie
    Replies: 2
    Last Post: 7th March 2007, 18:10
  3. .ui file name and classname
    By Rekha in forum Newbie
    Replies: 3
    Last Post: 12th August 2006, 01:53
  4. SQLite-DB in a qrc file
    By Lykurg in forum Qt Programming
    Replies: 5
    Last Post: 31st July 2006, 19:24
  5. dialog box
    By Bahar in forum Qt Programming
    Replies: 3
    Last Post: 31st January 2006, 14:52

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.