Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. How to design this problem - started multiple file uploads to server and then perform a task corresponding to each finished upload
Forum Updated to NodeBB v4.3 + New Features

How to design this problem - started multiple file uploads to server and then perform a task corresponding to each finished upload

Scheduled Pinned Locked Moved Mobile and Embedded
3 Posts 2 Posters 1.1k Views 1 Watching
  • 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.
  • R Offline
    R Offline
    raj.qtdev
    wrote on 24 Jul 2013, 20:07 last edited by
    #1

    Hi,

    I have this task at hand where in multiple file uploads can be started. Once a particular upload gets finished, I need to perform a particular task. I am using _QNetworkAccessManager _to upload files using PUT method and getting callbacks for finished uploads in finished(QNetworkReply* ) method.

    Can somebody help me design the solution to this problem? Basically i want to know how do I make sure that a particular upload has finished and finished callback corresponds to that particular upload and not any other upload as upload of a smaller file might get finished before a big file upload. How to generalize the solution to this problem?

    Any suggestions/hints appreciated.
    Thanks

    1 Reply Last reply
    0
    • G Offline
      G Offline
      Gianluca
      wrote on 25 Jul 2013, 09:35 last edited by
      #2

      Do you know the QtConcurrent framework ??
      http://qt-project.org/doc/qt-5.1/qtconcurrent/qtconcurrent-index.html

      What I will do is to create a method that manage the upload in a blocking way and return only when the upload of the file has been completed (or return an error).
      Then, I will use the QtConcurrent to run a pool of such methods in parallel that uploads different files.
      And then, I will use a QFutureWatcher to execute whatever you need when one upload has been completed.
      http://qt-project.org/doc/qt-5.1/qtcore/qfuturewatcher.html#resultReadyAt

      Cheers,
      Gianluca.

      1 Reply Last reply
      0
      • R Offline
        R Offline
        raj.qtdev
        wrote on 25 Jul 2013, 11:18 last edited by
        #3

        No I never used them.

        Would be great if you could provide me with some working example of this.

        Thanks

        1 Reply Last reply
        0

        1/3

        24 Jul 2013, 20:07

        • Login

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