$value) { if(!$topLevel) $key=stripslashes($key); if(is_array($value)) $newArray[$key]=undoMagicQuotes($value,0); else $newArray[$key]=stripslashes($value); } return $newArray; } } $_REQUEST=undoMagicQuotes($_REQUEST); } if(isset($_REQUEST['file'])){ $file=$_REQUEST['file']; $filename=basename($file); if(isset($_REQUEST['filename'])) $filename=$_REQUEST['filename']; $filename=str_replace('"','\\"',$filename); if (!function_exists('mime_content_type')){ function mime_content_type($f){ return trim(exec('file -bi '.escapeshellarg($f))); } } header('Content-type: '.mime_content_type($file)); header("Content-Disposition: attachment; filename=\"".$filename."\""); readfile($file); } ?>