Здравейте! Изполозвам този код за ъплоуд на аватари. Той оразмерява аватара до 150х150, но след като го оразмери ми излиза прозорец за сваляне на оразмерената снимка. Как да го преработя така, че оразмереният аватар да се сваля в определена папка на хоста ми, без на хората да им излиза прозорец за сваляне?

Мерси предварителноif ($_SERVER['REQUEST_METHOD'] == 'POST')
{
if ($_FILES['image']) {
preg_match('/\.([A-Za-z]+?)$/', $_FILES['image']['name'], $matches);
$matches[1] = strtolower($matches[1]);
if ($matches[1] == 'png' && function_exists('imagecreatefrompng')
|| $matches[1] == 'jpg' && function_exists('imagecreatefromjpeg')
|| $matches[1] == 'jpeg' && function_exists('imagecreatefromjpeg')
|| $matches[1] == 'gif' && function_exists('imagecreatefromgif')
|| $matches[1] == 'bmp' && function_exists('imagecreatefromwbmp')) {
list ($owidth, $oheight) = getimagesize($_FILES['image']['tmp_name']);
if ($_POST['resizeby'] == 'height')
{
$nheight = 150;
$nwidth = $nheight / $oheight * $owidth;
$resized = imagecreatetruecolor($nwidth, $nheight);
}
else
{
$nwidth = 150;
$nheight = $nwidth / $owidth * $oheight;
$resized = imagecreatetruecolor($nwidth, $nheight);
}
if ($matches[1] == 'png')
$original = imagecreatefrompng($_FILES['image']['tmp_name']);
if ($matches[1] == 'jpg' || $matches[1] == 'jpeg')
$original = imagecreatefromjpeg($_FILES['image']['tmp_name']);
if ($matches[1] == 'gif')
$original = imagecreatefromgif($_FILES['image']['tmp_name']);
if ($matches[1] == 'bmp')
$original = imagecreatefromwbmp($_FILES['image']['tmp_name']);
imagecopyresampled($resized, $original, 0, 0, 0, 0, $nwidth, $nheight, $owidth, $oheight);
header('Content-Disposition: attachment; filename="'.$_FILES['image']['name'].'"');
header('Content-type: image/'. (($matches[1] == 'jpg') ? 'jpeg' : $matches[1]));
if ($matches[1] == 'png')
imagepng($resized);
if ($matches[1] == 'jpg' || $matches[1] == 'jpeg')
imagejpeg($resized);
if ($matches[1] == 'gif')
imagegif($resized);
if ($matches[1] == 'bmpg')
imagewbmp($resized);
exit();
}
else
$error = 'File type not supported!';
}
else
$error = 'No image uploaded!';
}
?>