-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.php
More file actions
executable file
·58 lines (44 loc) · 1.73 KB
/
example.php
File metadata and controls
executable file
·58 lines (44 loc) · 1.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
include('uploader.php');
if (isset($_POST['upload'])){
$file_size='2000000';//dosya boyutu
$allowed_types='jpg,gif,png';//izin verilen uzantılar
$path='uploads';//yükleme yapılacak klasor
$input_names =array();
$input_names=$_FILES['uploadPic'];
$Uploader = & new stnc_file_upload();
/*
* eğer true ise dosya orginal ismi ile kaydedilir
* false verirseniz dosya yeniden rastgele isimlendirilir onceden aynı isimde dosya varsa üzerine yazar
* önemli !false ise onek ve sonek de aktifdir
* dosya ya önek ve sonek vermek içindir
* */
$Uploader->name_format (false,'st_','_nc');
$Uploader->picture_control_value=true;//resimin gerçek olup olmadığını kontrol eçindir
$Uploader->uploader_set($input_names, $path, $allowed_types,$file_size);//çalıştırıcı
echo $Uploader->result_report(); //rapor hata vss
//$Uploader->uploaded_files[0]; //yüklenen dosyaların isimleri kaçsını almak istersek ama lattaki gibi tümünüde göndeüebilrisiniz
//örnek yüklenenlerin isimlerini almak için
if (count($_FILES['uploadPic']['name'])>0) { //eğer herhangi bir resim yuklenmişse
for ($i = 0; $i < count($Uploader->uploaded_files); $i ++) {
$picture = $Uploader->uploaded_files[$i];
}
} }
?>
<form action="" method="post" enctype="multipart/form-data">
<input name="uploadPic[]" type="file" />
<br>
<input name="uploadPic[]" type="file" />
<br>
<input name="uploadPic[]" type="file" />
<br>
<input name="uploadPic[]" type="file" />
<br>
<input name="uploadPic[]" type="file" />
<br>
<input name="uploadPic[]" type="file" />
<br>
<input name="uploadPic[]" type="file" />
<br>
<input name="upload" type="submit" value="Upload" />
</form>