<?php
// We define the message callback function
function msgcallback_function($msg, $level)
{
if ($level >= UUMSG_NOTE)
echo "$msg";
}
// We define the busy callback function
function busycallback_function($uuprogress)
{
echo "<br><br>Action : ".$uuprogress->action;
echo "<br>Curfile : ".$uuprogress->curfile;
echo "<br>Partno : ".$uuprogress->partno;
echo "<br>Numparts : ".$uuprogress->numparts;
echo "<br>Percent : ".$uuprogress->percent;
echo "<br>Fsize : ".$uuprogress->fsize."<br><br>";
}
// We initialize the library
php_uuinitialize();
// We indicate the function of treatment for the messages generated by the library
php_uusetmsgcallback ("msgcallback_function");
// We indicate that the busy callback function must be called every 100 ms.
php_uusetbusycallback("busycallback_function", 100);
// We open the source and destination files.
$source_file = fopen('c:\Apache\test.rar', "r");
$destination_file = fopen('c:\01 - before decoding\test.yenc', "w");
// We try to encode the data
php_uuencodetostream($destination_file, $source_file, YENC_ENCODED, 'test.rar');
// We close the files.
fclose ($source_file);
fclose ($destination_file);
// We clean up all the resources.
php_uucleanup();
?>
|