DonanımHaber Mini sürüm 2 Ocak 2026 tarihi itibariyle kullanımdan kalkacaktır. Bunun yerine daha hızlı bir deneyim için DH Android veya DH iOS uygulamalarını kullanabilirsiniz.
Arama butonu
Bu konudaki kullanıcılar: 1 misafir, 1 mobil kullanıcı
2
Cevap
665
Tıklama
0
Öne Çıkarma
Php çoklu dosya yükleme sistemi
O
12 yıl (109 mesaj)
Çavuş
Konu Sahibi

<?PHP
////////////////////////////////////////////////
// Ozer Php Dosya yükleme sistemi //////
// By Ozernet h-ozernet@hotmail.com //////
////////////////////////////////////////////////
echo <<<DilTr
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
DilTr;
$cwd = getcwd()."/"; $cwd = str_replace("//","/",$cwd); $yuklemeyeri = "$cwd"; // yuklenecek yer belirleme..
$yuklemetipi = array("jpg","gif", "png", "bmp", "jpeg", "mp3", "exe");// format belirle..
if($yukleme == "yukle"){ for ($dosya_i = 1; $dosya_i < ($dosya_no+1); $dosya_i++) {
$yeni_dosya = 'dosya_'.$dosya_i; $dosya = $_FILES[$yeni_dosya]['tmp_name']; $dosya_ismi = $_FILES[$yeni_dosya]['name'];
$dosya_ismi = str_replace(" ", "_", $dosya_ismi); $dosya_ad = explode(".",$dosya_ismi); $type = end($dosya_ad);
if($dosya_ismi == ""){ $dos_result .= "<br><font color=red>$yeni_dosya -> Yuklemek için dosya seçmediniz!</font>"; }
elseif( !isset($overwrite) and file_exists($yuklemeyeri."/".$dosya_ismi)){ $dos_result .= "<br><font color=red>$dosya_ismi ->
Dosya yuklenemedi!</font>";} elseif( !(in_array($type, $yuklemetipi) or in_array(strtolower($type), $yuklemetipi)) ){
$dos_result .= "<br><font color=red>$dosya_ismi ->Dosyanız yüklenebilir tipde degil. !!!</font>";
}else{ @copy($dosya, $yuklemeyeri."/".$dosya_ismi) or $dos_result .= "<br><font color=red>$dosya_ismi ->
Server dosyanın kopyalanmasına izin vermedi</font><br /> php.ini dosyasında gerekli ayar yapılmamış olabilir.";
if(file_exists($yuklemeyeri."/".$dosya_ismi)) { $dos_result .= "<br><font color=green>$dosya_ismi -> Dosya yüklendi.</font>"; }//dosya yükleme ..
} } }
//js çoklu yüklme
echo<<<HTMLJS
<script language='javascript'>
function TabloEkle() {
var tab = document.getElementById('tab-ekle');
var lastRow = tab.rows.length;
var iteration = lastRow+1;
var row = tab.insertRow(lastRow);
var cellRight = row.insertCell(0);
var el = document.createElement('input');
el.setAttribute('type', 'file');
el.setAttribute('name', 'dosya_' + iteration);
el.setAttribute('size', '30');
el.setAttribute('value', iteration);
cellRight.appendChild(el);
document.getElementById('dosya_no').value = iteration;
}
function TabloSil() {
var tab = document.getElementById('tab-ekle');
var lastRow = tab.rows.length;
if (lastRow > 1){
tab.deleteRow(lastRow - 1);
document.getElementById('dosya_no').value = document.getElementById('dosya_no').value - 1;
}
}
</script>
HTMLJS;
echo<<<HTMLFORM
<form name="form" id="form" action="$PHP_SELF?mod=yuklemeler" method="post" enctype="multipart/form-data">
<table border=0 cellpading=0 cellspacing=0 width=100%>
<td height=33><b>Ozernet Yukleme Sistemi</b>       <a data-test="test" rel="nofollow" style="word-wrap: break-word; text-decoration: underline;" target="_blank" onclick="return dhExternalLinkRedirect(this)" href="/ExternalLinkRedirect?module=pgdcode&messageId=78358543&url=yukle.php?" data-href="yukle.php?">Yenile</a>
<table border=0 cellpading=0 cellspacing=0 class="panel" cellpadding=8><tr><td height=25>
<table border="0" cellspacing="0" cellpadding="0" id="tab-ekle"><tr id="row">
<td width="1" colspan="2"><input type="file" size="30" name="dosya_1"></td></tr></table>
<table border="0" cellspacing="0" cellpadding="0" style="margin-top:5px;"><tr><td>
<INPUT TYPE="SUBMIT" name="submit" VALUE="yukle" style="font-weight:bold;">  
<input type=button value='-' style="font-weight:bold; width:22px;" title='input kutusunu sil' onClick="TabloSil();return false;">
<input type=button value='+' style="font-weight:bold; width:22px;" title='input kutusu ekle' onClick="TabloEkle();return false;">  
<input style="border:0px; background-color:#F7F6F4;" type=checkbox name=overwrite id=overwrite value=1>
<label title='Overwrite file(s) if exist' for=overwrite> Overwrite</label>
</td></tr></table>$dos_result</table> <input type=hidden name=yukleme value=yukle> <input type=hidden name=action value='$yukleme'>
<input type=hidden name='dosya_no' id='dosya_no' value='1'>
</form>
HTMLFORM;
?>