You should use the _FILES super global to access binary uploaded files from a temporary directory on the server
OR
encode the binary data as Base64 (or some other text only encoding) for use in the _POST variable.

See http://php.net/manual/en/features.file-upload.php

To have the file appear in _FILES modify the doc example:
Qt Code:
  1. QHttpPart imagePart;
  2. imagePart.setHeader(QNetworkRequest::ContentTypeHeader, QVariant("image/jpeg"));
  3. imagePart.setHeader(QNetworkRequest::ContentDispositionHeader, QVariant("form-data; name=\"image\"; filename=\"image.jpg\"")); // <<< filename triggers separate handling
  4. QFile *file = new QFile("image.jpg");
  5. file->open(QIODevice::ReadOnly);
  6. imagePart.setBodyDevice(file);
  7. file->setParent(multiPart); // we cannot delete the file now, so delete it with the multiPart
To copy to clipboard, switch view to plain text mode 
and then you will see in the PHP environment:
Qt Code:
  1. chrisw@newton /tmp/simple_example $ ./simple_example
  2. // _POST array
  3. array(1) {
  4. ["text"]=>
  5. string(7) "my text"
  6. }
  7. // _FILES array
  8. array(1) {
  9. ["image"]=>
  10. array(5) {
  11. ["name"]=>
  12. string(9) "image.jpg"
  13. ["type"]=>
  14. string(10) "image/jpeg"
  15. ["tmp_name"]=>
  16. string(14) "/tmp/phpaLYWWk"
  17. ["error"]=>
  18. int(0)
  19. ["size"]=>
  20. int(16246)
  21. }
  22. }
To copy to clipboard, switch view to plain text mode