Location: PHPKode > projects > AudioCMS arash > arash/tool/upload.php
<?php
$size=0;
if ($redirekt == "") {
   $redirekt = ereg_replace ("(\?.*)","",$HTTP_REFERER);
   }
$fname = $_FILES['datei']['name'];
$tmp_name = $_FILES['datei']['tmp_name'];
if($fname == "") {
    header("Location: ".$redirekt."?action=uploaderror");
   return;
  }
else
{
$path_info = pathinfo($fname);
$new_filename = $path_info["basename"];
$ext=$path_info["extension"];
$new_filename=substr($new_filename,0,strlen($new_filename)-4);
$zeit= time();
$new_filename= $new_filename.'_'.$zeit.".".$ext;
 $orig = array("ä","Ä","ö","Ö","ü","Ü","ß"," ");
 $replace = array("ae","Ae","oe","OE","ue","UE","sz","_");
  for($x=0;$x<3;$x++){
    $new_filename = str_replace($orig[$x],$replace[$x],$new_filename);
   }
    if(copy($tmp_name,$uploaddir.$new_filename)){
       if(is_uploaded_file($datei)){
          $zeit=time();
          $size=filesize($uploaddir."/".$new_filename);
          header("Location: ".$redirekt."?action=uploaded&filename=$new_filename&size=$size&zeit=$zeit");
          }
       }  else {
              header("Location: ".$redirekt."?action=uploaderror");
           }

header("Location:".$redirekt."?action=uploaded&filename=$new_filename&size=$size&zeit=$zeit");
#print $cgi->header(   -type=>'text/html');
}

?>

Return current item: AudioCMS arash