Location: PHPKode > projects > Ajax File Manager - AjaxExplorer > ajaxexplorer/script/upload.php
<?php

/*
AjaxExplorer Copyright (C) 2007-2008 Syed Mohammad Sidque Tahir Al-Habshi

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Head to
GNU site http://www.gnu.org/licenses/ for license copy.
*/

if($name=isset($_FILES['upload'])? $_FILES['upload']['name']:0)
{
  if($userid && $perm & 0x0001 && $perm>7)
  {
    if(($maxsize*1024)>$_FILES['upload']['size'])
    {
      $file=$root.($dirc=Post('dirc')).$_FILES['upload']['name'];

      if($replace || !file_exists($file))
      {
	if(is_uploaded_file(($temp=$_FILES['upload']['tmp_name'])))
	{
	  echo move_uploaded_file($temp, $file)? 'top.fileDraw("'.$name.'", '.$_FILES['upload']['size'].', '.time().');top.fileSort();':'';
	  $does="Upload\t".$dirc."\t".$name;
	  include 'track.php';
	}
      }
    }
    else $text='top.fileDetail(0);top.alert(\'Unable to upload '.$name.'\nFile size must be under '.$maxsize.' KB\');';
  }
  else $text='top.alert(\'You do not have the permission!\');';
}

?>
Return current item: Ajax File Manager - AjaxExplorer