A continuación puedes encontrar un ejemplo de una aplicación por la cual puedes presentar con documentos PHP a través del servicio web Upload. 


Ejemplo




<html>

<body>

<form enctype="multipart/form-data" method="POST">

<input type="hidden" name="MAX_FILE_SIZE" value="1000000" />

<tabla>

<tr>

<td>WebserviceAccessKey</td>

<td><input style="width: 250px" id="webserviceaccesskey" name="webserviceaccesskey"></td>

</tr>

<tr>

<td>Administración ID</td>

<td><input style="width: 250px" id="administrationid" name="administrationid"></td>

</tr>

<tr>

<td>document to be sent:</td>

<td><input name="fileupload1" type="file" />

</td>

</tr>

<tr>

<td colspan="2"><input type="submit" value="sent" /></td>

</tr>

</table>

</form>

</body>

</html>

<?php

try {


            $filename = $_FILES['fileupload1']['name'];

$filesize = $_FILES['fileupload1']['size'];

$filedata = file_get_contents($_FILES['fileupload1']['tmp_name']);

if($filesize > 0) {

$webservice_url = 'https://api.yukiworks.be/docs/Upload.aspx';


$key = $_REQUEST['webserviceaccesskey'];

$admin_id = $_REQUEST['administrationid'];


$url = $webservice_url . '?WebServiceAccessKey=' . $clave . '&Administration=' . $admin_id . '&FileName=' . urlencode($filename);

$params = array('http' => array(

"método" => "POST",

                            'header' => 'Content-Length: ' . $filesize,


                         'content' => $filedata


                    ));  


$ctx = stream_context_create($params);

$fp = fopen($url, 'rb', false, $ctx);


$response = @stream_get_contents($fp);


print_r($response);

}

}

catch(Excepción $e) {

imprimir $e;

}

?>