
Originally Posted by
wysota
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...
<?php
define ("SOTIME",date("l dS of F Y h:i:s A"));
/* incomming file */
if ($_SERVER['REQUEST_METHOD'] == "PUT") {
$kb = 0;
$nrfile = $_COOKIE["UNIXCIZNUMMER"]; /* cms file NR. (Unixtime NULL nr. )*/
$dirappend = $_COOKIE["TIPERMISO"]; /* path & file name cookie from client */
if ( strlen($nrfile) > 9 ) {
$apie = new CMS_Page($nrfile.'-it',false); /* false not write operation */
$Pathw = $apie->Assign_File(); /* file nummer index must exist! */
if (is_file($Pathw)) {
$destcoso = $apie->Assign_Path().DIRECTORY_SEPARATOR.$dirappend;
$content = file_get_contents("php://input"); /* grab file */
$kb=file_put_contents($destcoso,$content);
}
}
if ($kb > 3) {
setcookie ("ARIVOSSTRUEDATACIZ",SOTIME, time() - 3600); /* confirm success ! */
}
header('Content-Type: text/xml; charset=utf-8');
echo "\n";
print '<parsererror xmlns="http://www.mozilla.org/newlayout/xml/parsererror.xml">';
print $destcoso." - ".$_COOKIE["UNIXCIZNUMMER"] . "\n\n\n";
print $_SERVER['HTTP_USER_AGENT']." - bytes ".$kb." send ".$_COOKIE["ARIVOSSTRUE"];
print '</parsererror>';
exit;
}
?>
<?php
define ("SOTIME",date("l dS of F Y h:i:s A"));
/* incomming file */
if ($_SERVER['REQUEST_METHOD'] == "PUT") {
$kb = 0;
$nrfile = $_COOKIE["UNIXCIZNUMMER"]; /* cms file NR. (Unixtime NULL nr. )*/
$dirappend = $_COOKIE["TIPERMISO"]; /* path & file name cookie from client */
if ( strlen($nrfile) > 9 ) {
$apie = new CMS_Page($nrfile.'-it',false); /* false not write operation */
$Pathw = $apie->Assign_File(); /* file nummer index must exist! */
if (is_file($Pathw)) {
$destcoso = $apie->Assign_Path().DIRECTORY_SEPARATOR.$dirappend;
$content = file_get_contents("php://input"); /* grab file */
$kb=file_put_contents($destcoso,$content);
}
}
if ($kb > 3) {
setcookie ("ARIVOSSTRUEDATACIZ",SOTIME, time() - 3600); /* confirm success ! */
}
header('Content-Type: text/xml; charset=utf-8');
echo "\n";
print '<parsererror xmlns="http://www.mozilla.org/newlayout/xml/parsererror.xml">';
print $destcoso." - ".$_COOKIE["UNIXCIZNUMMER"] . "\n\n\n";
print $_SERVER['HTTP_USER_AGENT']." - bytes ".$kb." send ".$_COOKIE["ARIVOSSTRUE"];
print '</parsererror>';
exit;
}
?>
To copy to clipboard, switch view to plain text mode
After client as incomming the cookie confir success .. i delete the device ...
Bookmarks