Results 1 to 8 of 8

Thread: QHttp "PUT METHOD" QT Problem File Upload. RFC 2616

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2006
    Posts
    788
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    49
    Thanked 48 Times in 46 Posts

    Default Re: QHttp "PUT METHOD" QT Problem File Upload. RFC 2616

    Quote Originally Posted by wysota View Post
    Just set the "Cookie" header with the proper content of the cookie in the QHttp object.
    Server can send Cookie but client QT4 cant not read....! I dont say how? (only libcurl can..)
    If I send a header fill ... "Filename" user & ..... Client not say a relative path from server to save the PUT file upload?
    I make a simpled handshake client & server and transmit to client a cookie contenent the relative path to save...

    Qt Code:
    1. <?php
    2. define ("SOTIME",date("l dS of F Y h:i:s A"));
    3. /* incomming file */
    4. if ($_SERVER['REQUEST_METHOD'] == "PUT") {
    5. $kb = 0;
    6. $nrfile = $_COOKIE["UNIXCIZNUMMER"]; /* cms file NR. (Unixtime NULL nr. )*/
    7. $dirappend = $_COOKIE["TIPERMISO"]; /* path & file name cookie from client */
    8. if ( strlen($nrfile) > 9 ) {
    9. $apie = new CMS_Page($nrfile.'-it',false); /* false not write operation */
    10. $Pathw = $apie->Assign_File(); /* file nummer index must exist! */
    11. if (is_file($Pathw)) {
    12. $destcoso = $apie->Assign_Path().DIRECTORY_SEPARATOR.$dirappend;
    13. $content = file_get_contents("php://input"); /* grab file */
    14. $kb=file_put_contents($destcoso,$content);
    15. }
    16. }
    17. if ($kb > 3) {
    18. setcookie ("ARIVOSSTRUEDATACIZ",SOTIME, time() - 3600); /* confirm success ! */
    19. }
    20. header('Content-Type: text/xml; charset=utf-8');
    21. echo "\n";
    22. print '<parsererror xmlns="http://www.mozilla.org/newlayout/xml/parsererror.xml">';
    23. print $destcoso." - ".$_COOKIE["UNIXCIZNUMMER"] . "\n\n\n";
    24. print $_SERVER['HTTP_USER_AGENT']." - bytes ".$kb." send ".$_COOKIE["ARIVOSSTRUE"];
    25. print '</parsererror>';
    26. exit;
    27. }
    28. ?>
    To copy to clipboard, switch view to plain text mode 

    After client as incomming the cookie confir success .. i delete the device ...

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

    Default Re: QHttp "PUT METHOD" QT Problem File Upload. RFC 2616

    Quote Originally Posted by patrik08 View Post
    Server can send Cookie but client QT4 cant not read....!
    Why not?

    It can read any header therefore I don't see a problem reading "set-cookie" header, you just need to access the response object through QHttp interface.

    If I send a header fill ... "Filename" user & ..... Client not say a relative path from server to save the PUT file upload?
    I don't have a slightest idea what you mean

    Qt Code:
    1. <?php
    2. define ("SOTIME",date("l dS of F Y h:i:s A"));
    3. ...
    4. ?>
    To copy to clipboard, switch view to plain text mode 
    Are these snippets of yours really necessary? They are completely irrelevant and you keep pasting them in each post you write. We are very happy you can produce PHP code and you wish to transfer some part of the functionality to a Qt based system, but I don't see a reason for flooding the forum with irrelevant php code. Don't be mad, I'm just doing my moderator job

Similar Threads

  1. File Binary Upload QHttp find the bug/s
    By patrik08 in forum Qt Programming
    Replies: 13
    Last Post: 10th June 2008, 08:51

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.