if (!empty($_FILES)) {
$files =time().'_';
$tempFile = $_FILES['Filedata']['tmp_name'];
$targetPath = $_SERVER['DOCUMENT_ROOT'] . $_GET['folder'] . '/';
$targetFile = str_replace('//','/',$targetPath) .$files. $_FILES['Filedata']['name'];
$filename =$files. $_FILES['Filedata']['name'];
move_uploaded_file($tempFile,$targetFile);
}
@unlink($targetFile);
echo $filename;