<?php require_once('includes/requirelogin.inc.php'); header("Content-Type: text/xml; charset=utf8"); $xml=simplexml_load_string("<?xml version='1.0'?><progress/>"); if (function_exists("apc_fetch")) $upload_status=apc_fetch("upload_$_GET[upload_key]"); if ($upload_status['total']) { $xml->addChild('percent',sprintf('%0.1f',100*$upload_status['current']/$upload_status['total'])); $xml->addChild('cancelled',$upload_status['cancel_upload']); if ($upload_status['path']) $xml->addChild('path',$upload_status['path']); else $upload_status['done']=0; if ($upload_status['error']) { $xml->addChild('error',$upload_status['error']); $upload_status['done']=1; } $xml->addChild('done',$upload_status['done']); } echo $xml->asXML(); ?>