PHP’de Ftp ye Bağlanmadan Servere Dosya Gönderme

<form name="form1" enctype="multipart/form-data" action="<? echo $PHP_SELF;?>" method="post"><input type="file" name="dosya"><br><input type="submit" name="gonder" value="Gönder"></form>
<?
//Yüklenecek dosyanın max boyutu - burda 2 Mb olarak belirledim
ini_set("upload_max_filesize","2M");
$rasgele = md5(microtime());// Dosyanın serverda aynısı varmı yokmu kontrol etmenize gerek kalmadan oluşturulan koda göre kaydeder
echo $dosya;
$dosya_name=$rasgele.'_'.$dosya_name;
copy ( $_FILES['dosya']['tmp_name'], $dosya_name )
?>

Be the first to comment

Leave a Reply

Your email address will not be published.


*