rendered paste body<?$ufile = $_FILES["userfile"];$upload_dir = "dosyalar/";UpFile($ufile,$upload_dir);function UpFile($ufile,$upload_dir){ // dosya biçimleri $file_types = array('application/zip','text/plain','image/gif','image/jpeg','image/jpeg','image/png','application/x-tar','application/x-gzip','audio/mpeg','video/quicktime','application/msword','application/vnd.ms-excel','text/xml','video/x-msvideo','text/css','application/vnd.oasis.opendocument.presentation','application/vnd.oasis.opendocument.text','application/vnd.oasis.opendocument.spreadsheet','application/x-bittorrent','application/pdf','application/x-shockwave-flash','audio/x-wav'); // dosya uzantıları$file_exts = array('.zip','.txt','.gif','jpeg','.jpg','.png','tar','.gz','.mp3'.'.mov','.doc','.xls','.xml','.avi','.css','.odp','.odt','.ods','.torrent','.pdf','.swf','.wav'); // upload dizini yoksaif (!is_dir($upload_dir)) { return 4; }$file_name = $_FILES[$ufile]['name']; // gönderilen dosyanın adı$file_type = $_FILES[$ufile]['type']; // gönderilen dosyanın tipi$file_ext = strtolower(substr($file_name,strrpos($file_name,"."))); // dosyauzantısını alalımif (!empty($file_name) && !empty($file_type)) { // dosya adı ve tipi boş değilseif (!in_array($file_type, $file_types) && !in_array($file_ext, $file_exts)) { // dosya tipleri ve dosya uzantısı birbirine uygun mu ?return 6; } else { // upload file$tempname = $_FILES[$ufile]['tmp_name']; // dosyanın geçici adresi$file_name = str_replace("\\","",$file_name); // $file_name = str_replace("'","",$file_name); // $file_path = $upload_dir.md5(time())."_".$file_name; // dosyanın yeni adresi// dosyanın yüklenmiş olduğunu kontrol edelim,if(is_uploaded_file($tempname)){ // dosya yüklenmiş iseif(!move_uploaded_file($tempname,$file_path)){// dosya taşınamaz isereturn 7; } else {if(!chmod($file_path, 0755)){// dosya izinleri verilemedireturn 8;} else {// dosya yüklendi ve kullanıma hazırreturn $file_path;}}} else { // dosya yükleme ile ilgili bir sorun var, bu bir saldırı olabilirreturn 9; } } } else { // içerik boşreturn 5; } }?>