I am having trouble with QHttp and related classes when trying to post a file to a server.
No matter what I try, the header response is: "Internal server error"

My code below (error checks, signals and checks for return values removed for clarity)
Qt Code:
  1. QHttp *http;
  2. QFile *file;
  3. QUrl url(lineEdit_url->text());
  4. file = new QFile(lineEdit_filename->text());
  5. file->open(QIODevice::ReadOnly)
  6. http->setHost(url.host(),url.port() != -1 ? url.port() : 80);
  7. if(!url.userName().isEmpty())
  8. http->setUser(url.userName(),url.password());
  9. http->post(url.path(),file);
To copy to clipboard, switch view to plain text mode 

Here is a working html form for posting to this server:
Qt Code:
  1. <form method=post enctype="multipart/form-data" action=/uploader/Default.asp>
  2. Username:<br/><input type="text" name="username"><br/><br/>
  3. Password:<br/><input type="password" name="password"><br/><br/>
  4. Your File:<BR><input type=file name=YourFile><BR><BR>
  5. <input type=submit name=submit value="Upload">
  6. </form>
To copy to clipboard, switch view to plain text mode 

There are no examples in qtassistant apart from the brief description of QHttp:: post()

Any help is deeply appreciated!