Results 1 to 2 of 2

Thread: QHttp request problem on MAC Pro

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2007
    Posts
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default QHttp request problem on MAC Pro

    Hello Every one

    i have developed an application for upload file to server on MAC pro.it works fine when i have login in computer in as Admin mode ...but System got crashes (KERNAL PANIC )when i login as parental account .......code is given below

    Qt Code:
    1. QString fileName = filename;
    2. QFile *userfile = new QFile(fileName);
    3. if ( !userfile->open(QIODevice::ReadOnly) )
    4. {
    5. QMessageBox::information(this, tr("HTTP"),
    6. tr("Unable to open the file %1: %2.")
    7. .arg(userfile->errorString()));
    8. }
    9.  
    10. QHttpRequestHeader header("POST", "/macUpd.php",1,1);
    11. header.setValue("Host","192.168.100.161");
    12. header.setValue("Content-type", "multipart/form-data, boundary=AaB03x");
    13. header.setValue("Cache-Control", "no-cache");
    14. header.setValue("Accept","*/*");
    15. QByteArray byt(fileName.toUtf8());
    16. QByteArray bytes;
    17. bytes.append("--AaB03x\r\n");
    18. bytes.append("content-disposition: ");
    19. bytes.append("form-data; name=\"uploadfile\"\r\n");
    20. bytes.append("\r\n");
    21. bytes.append("0\r\n");
    22. bytes.append("--AaB03x\r\n");
    23. bytes.append("content-disposition: ");
    24. bytes.append("form-data; name=\"uploadfile\"; filename=\"" + byt+ "\"\r\n");
    25. bytes.append("Content-Transfer-Encoding: binary\r\n");
    26. bytes.append("\r\n");
    27. bytes.append(userfile->readAll());
    28. userfile->close(); // the file is opened earlier in the code
    29. bytes.append("\r\n");
    30. bytes.append("--AaB03x--");
    31. int contentLength = bytes.length();
    32. header.setContentLength(contentLength);
    33. http->request(header, bytes,0);
    To copy to clipboard, switch view to plain text mode 

    is there any idea from u gye......why SYSTEM crashes when it run from parental account on MAC pro .

    Thanks
    Last edited by jpn; 30th December 2008 at 13:44. Reason: missing [code] tags

Similar Threads

  1. Problem with QHttp requestFinished
    By jdd81 in forum Qt Programming
    Replies: 0
    Last Post: 7th November 2008, 00:31
  2. QHttp proxy problem
    By andre.rigon in forum Qt Programming
    Replies: 2
    Last Post: 28th September 2008, 22:19
  3. problem in using QHttp
    By Ferdous in forum Newbie
    Replies: 4
    Last Post: 10th September 2008, 13:07
  4. Problem in using QHttp with QTimer
    By Ferdous in forum Newbie
    Replies: 2
    Last Post: 6th September 2008, 13:48
  5. QHTTP get request
    By s410i in forum Qt Programming
    Replies: 1
    Last Post: 5th September 2008, 18:35

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
  •  
Qt is a trademark of The Qt Company.