ibocum adlı üyeden alıntı: mesajı görüntüle
Bunu kullanabilirsiniz;

if ($_FILES["dosya"]) {

  $yol = "dosyalar";

  $yuklemeYeri = __DIR__ . DIRECTORY_SEPARATOR . $yol . DIRECTORY_SEPARATOR . $_FILES["dosya"]["name"];

  if ( file_exists($yuklemeYeri) ) {

      echo "Dosya daha önceden yüklenmiş";

  } else {

      if ($_FILES["dosya"]["size"]  > 1000000) { # 1 MB dosya sınırı

          echo "Dosya boyutu sınırı";

      } else {

          $dosyaUzantisi = pathinfo($_FILES["dosya"]["name"], PATHINFO_EXTENSION);

          if ($dosyaUzantisi != "jpg" && $dosyaUzantisi != "png") { # Dosya uzantı kontrolü

              echo "Sadece jpg ve png uzantılı dosyalar yüklenebilir.";

          } else {

              $sonuc = move_uploaded_file($_FILES["dosya"]["tmp_name"], $yuklemeYeri);

              echo $sonuc ? "Dosya başarıyla yüklendi" : "Hata oluştu";

          }

      }

  }

} else {

  echo "Lütfen bir dosya seçin";

}
denedim ama olmadı kod aşağıda nasıl eklemem gerekli bilgilendirirsen sevinirim
if ($_POST) {
    $foo = new upload($_FILES['pp']);
    if ($foo->uploaded) {
        $foo->file_new_name_body = 'pp-img';
        $foo->process('../images/pp');
        if ($foo->processed) {
           $pp_get = $foo->file_dst_name;
           $resim_get1;
} else {
            echo"";
}
}