<?php
    require_once('../../../server/api-adodb/config.php');
    require_once(LIB_PATH.DS.'loggedin.php');
    require_once(LIB_PATH.DS.'session.class.php');
    ob_start();
   // Edit upload location here
   $destination_path = getcwd().DIRECTORY_SEPARATOR;

   $result = 0;

   $target_path = $destination_path . basename( $_FILES['myfile']['name']);

   if(@move_uploaded_file($_FILES['myfile']['tmp_name'], $target_path)) {
      $result = 1;
   }

   sleep(1);
?>

<script language="javascript" type="text/javascript">window.top.window.stopUpload(<?php echo $result; ?>);</script>
