Results 1 to 2 of 2

Thread: QHttp request problem on MAC Pro

  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 12:44. Reason: missing [code] tags

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: QHttp request problem on MAC Pro

    If you experience a system crash then the problems seems to be not in your application. Whatever it does, it can crash itself, but not the system.

    In doubt try switching from QHttp to QNetworkAccessManager, it is less error prone but I doubt this will help in any way.

Similar Threads

  1. Problem with QHttp requestFinished
    By jdd81 in forum Qt Programming
    Replies: 0
    Last Post: 6th November 2008, 23:31
  2. QHttp proxy problem
    By andre.rigon in forum Qt Programming
    Replies: 2
    Last Post: 28th September 2008, 21:19
  3. problem in using QHttp
    By Ferdous in forum Newbie
    Replies: 4
    Last Post: 10th September 2008, 12:07
  4. Problem in using QHttp with QTimer
    By Ferdous in forum Newbie
    Replies: 2
    Last Post: 6th September 2008, 12:48
  5. QHTTP get request
    By s410i in forum Qt Programming
    Replies: 1
    Last Post: 5th September 2008, 17: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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.