Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Any body knows filecatalyst...am using fileCatalystCL.jar. for downloading .

Any body knows filecatalyst...am using fileCatalystCL.jar. for downloading .

Scheduled Pinned Locked Moved General and Desktop
5 Posts 2 Posters 858 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Phani Madhavi
    wrote on last edited by
    #1

    can u please tell me how to get the size of file by using url

    1 Reply Last reply
    0
    • p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      Hi,

      I'm not sure about the fileCatalystCL.jar but you could use QNetworkAccessManager to get the size of the file by checking the QNetworkRequest::ContentLengthHeader.

      157

      1 Reply Last reply
      0
      • P Offline
        P Offline
        Phani Madhavi
        wrote on last edited by
        #3

        yes i used the same...
        QVariant fileSizeVar = reply->header(QNetworkRequest::ContentLengthHeader);
        long long fs = fileSizeVar.isValid() ? fileSizeVar.toLongLong() : 0;

        1 Reply Last reply
        0
        • P Offline
          P Offline
          Phani Madhavi
          wrote on last edited by
          #4

          QEventLoop eventLoop;
          manager = new QNetworkAccessManager(this);
          reply = manager->head(QNetworkRequest(assetUrl));
          connect(reply, SIGNAL(finished()), &eventLoop, SLOT(quit()));
          eventLoop.exec;

          QVariant fileSizeVar = reply->header(QNetworkRequest::ContentLengthHeader);

          qDebug() << "filesizeVar"<< fileSizeVar;
          long long fs = fileSizeVar.isValid() ? fileSizeVar.toLongLong() : 0;

          qDebug() << "File size captured: " << fs;
          

          am getting filesizeVar Qvariant(Invalid)

          1 Reply Last reply
          0
          • p3c0P Offline
            p3c0P Offline
            p3c0
            Moderators
            wrote on last edited by
            #5

            Ok. Any reason to use the QEventLoop ?
            Also please use the code tags "@@" to post a code here.

            157

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved