Results 1 to 3 of 3

Thread: How to get size file in a link?

  1. #1
    Join Date
    Jun 2011
    Posts
    16
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Symbian S60

    Default How to get size file in a link?

    I need to download a file on the internet, I use QNetworkManager and QNetworkReply. How do I know which file to download with size is?

  2. #2
    Join Date
    Jun 2011
    Location
    Finland
    Posts
    164
    Thanks
    1
    Thanked 26 Times in 26 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Maemo/MeeGo

    Default Re: How to get size file in a link?

    Use
    Qt Code:
    1. header(QNetworkRequest::ContentLengthHeader)
    To copy to clipboard, switch view to plain text mode 
    on your QNetworkReply. You will get content-length.
    Don't write a post just to thank someone, use "Thanks" button.

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

    Default Re: How to get size file in a link?

    If you need to, you can issue a HEAD request to retrieve the headers without actually receiving the content. There may be a "Content-Disposition:" header (see RFC 2183) that contains the server's recommended file name.

Similar Threads

  1. Replies: 11
    Last Post: 5th May 2011, 14:05
  2. Qhttp Get file size in Link download
    By nhs_0702 in forum Qt Programming
    Replies: 2
    Last Post: 17th April 2010, 09:24
  3. Qt static link with minimum size
    By foens in forum Installation and Deployment
    Replies: 0
    Last Post: 25th February 2010, 12:09
  4. How to link to a DLL in PRO file
    By richardander in forum Qt Programming
    Replies: 1
    Last Post: 23rd December 2008, 12:30
  5. How to link modified file
    By awalesminfo in forum Newbie
    Replies: 4
    Last Post: 22nd March 2006, 17:24

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.