<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Program Yükleme</title>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type" />
<link href="style.css" rel="stylesheet" type="text/css" />
<script type="text/javascript">
<!--
function add_input(){ // Inputlar
var input_wrapper = document.getElementById('input_wrapper');
var li = document.createElement('li');
var input = document.createElement('input');
input.type = 'file';
input.name = 'img[]';
li.appendChild(input);
li.appendChild(document.createTextNode(' '));
var button=document.createElement('input');
button.type = 'button';
button.className = 'button small';
button.onclick=function(){delete_input(this);};
button.value = 'Sil';
li.appendChild(button);
input_wrapper.appendChild(li);
}
function delete_input(field){ // Input sil
field.parentNode.parentNode.removeChild(field.pare ntNode);
}
//-->
</script>
</head>
<body>
<?php
if (isset($_POST['upfile'])){ // Yüklmekek icin herhangi bir islem baslatilmissa
if(!empty($_FILES['img']['tmp_name'])){ // Dosyanin Var Olup Olmadigini Kontrol ediyorum
$uploaddir = "programlar"; // Yüklenmesini istedigimiz Yeri Belirliyoruz
foreach($_FILES['img']['name'] as $key => $value){
// Dosya Büyüklügünü Kontrol Ediyor => max 100 000 Bytes olabilir (1024 byte = 1 kB)
if ($_FILES['img']['size'][$key] > 0 && $_FILES["file"]["size"] < 100000){
// Dosya Uzantilarini Kontrol Ederek Uygun Bicim Olup Olmadigina bakiyorum
if ($_FILES['img']['name'][$key] == '' && ($_FILES['img']['type'][$key] == 'image/gif') ||
($_FILES['img']['type'][$key] == 'image/jpeg') || ($_FILES['img']['type'][$key] == 'image/png') ||
($_FILES['img']['type'][$key] == 'image/pjpeg')) {
// dosyanin gönderilecegi yeri belirledikten sonra
$uploadfile = $uploaddir."/".basename($_FILES['img']['name'][$key]);
// Dosya belirledigimiz yere gönderiliyor
if (move_uploaded_file($_FILES['img']['tmp_name'][$key], $uploadfile)){
echo "<center><strong>".$value ."</strong> Basari ile yuklendi</center> <br />\n";
}
} else {
echo "{$_FILES['img']['name'][$key]} Dosyasinin Uzantisi Uygun Bicim Degil<br/>\n";
}
} // buyukluk kapat
}// foreach kapat
}// kontrol kapat
} // submit kapat
?>
<div id="ram">
<div id="header">
<h1>Program yükle</h1>
</div>
<div id="content">
<form method="post" action="" enctype="multipart/form-data">
<fieldset>
<legend>Dosya seçiniz</legend>
<ol id="input_wrapper">
<li><input name="img[]" type="file" />
<input class="button small" onclick="delete_input(this);" type="button" value="Sil" /></li>
<li><input name="img[]" type="file" />
<input class="button small" onclick="delete_input(this);" type="button" value="Sil" /></li>
<li><input name="img[]" type="file" />
<input class="button small" onclick="delete_input(this);" type="button" value="Sil" /></li>
</ol>
<p><input class="button right" onclick="add_input();" type="button" value="Yeni Ekle" /></p>
<br />
<input type="hidden" name="MAX_FILE_SIZE" value="100000" />
<input type="submit" name="upfile" value="Dosyalari Yukle" class="button "/>
</fieldset>
</form>
</div>
<div id="footer">
<p><a href="http://resimtab.com">ResimTab.Com</a> ·
</div>
</div>
</body>
</html>
hocam yukarıdaki kodu php index.php diye hostuna at birde hostuna programlar diye bir klasör aç. index.php den yüklemeye başla programlarını.