Authentic.SavePOST

www.altova.com Print this Topic Previous Page Up One Level Next page

Home >  User Reference > Objects > Authentic >

Authentic.SavePOST

See also

 

Declaration: SavePOST

 

Description

Saves the document to the URL specified by the property XMLDataSaveUrl. For the Untrusted versions, you can also use a full local path. The plug-in sends an HTTP POST request to the server to save the currently displayed XML file.

 

Checking whether file was saved or not

If the Authentic plug-in receives an HTTP response of >= 300 it will assume the file has not been saved and will (by default) pop-up first a message box containing the HTTP error response, then a second (suppressible) message box advising the user that the file has not been saved. It is up to the application developer to ensure that the correct HTTP response is returned according to the success or failure of the save attempt. An example of PHP code to achieve this might look like this:

 

<?php

// suppress error messages to prevent any output

// being generated before headers can be sent

error_reporting (0);

$error = false;

$handle = fopen ( "result.xml", "w+" );

if (! $handle)
$error = true;

else

{
if (! fwrite($handle, $HTTP_RAW_POST_DATA))
       $error = true;
else
       fclose($handle);

}

if ($error)
header( "HTTP/1.1 500 Server Error" );

?>

 

 


© 2019 Altova GmbH