bak dun bır ornek vermıstım buradakı gıbı kullan sen uzantıları neyse oyle ısmı neyse oyle yukletıyorsun mısal adam psd yuklese sıteye psd olarak yuklenecek bunları tek tıpte yukletmende ve ismini senın belırledıgın ısımde yukletmende fayda var.
senın dosya ( fotoğraf ) ısımlerınden dolayı bu hatayı verıyor
bunu ornek alabılırsın
heee sımdı bakınca gordum sen foto adlarına ne yazıyorsun su kodları bır yazıversene suraya
php ornegını yaptım gerısı sende
https://www.verot.net/php_class_upload_download.htm
gereklı dosyayı dahıl et
<?php
namespace Verot\Upload;
include('src/class.upload.php');
?>
<!DOCTYPE html>
<html lang="tr">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<form action="" method="POST" enctype="multipart/form-data">
<p>Resimler:
<input type="file" name="gorsel[]" multiple />
<input type="submit" name="resimkayit" value="Gönder" />
</p>
</form>
<?php
if((isset($_FILES['gorsel']))){
$dosya_yolu = "img/";
$files = array();
foreach ($_FILES['gorsel'] as $k => $l) {
foreach ($l as $i => $v) {
if (!array_key_exists($i, $files))
$files[$i] = array();
$files[$i][$k] = $v;
}
}
foreach ($files as $file) {
$handle = new Upload($file);
if ($handle->uploaded) {
// kucuk
$sifrele = rand(1234567,7654321);
$handle->file_new_name_body = $sifrele;
$handle->file_auto_rename = true;
$handle->image_resize = true;
$handle->image_x = 900;
$handle->image_ratio_y = true;
$handle->mime_check = true;
$handle->image_convert = 'jpg';
$handle->jpg_quality = 100;
$handle->Process($dosya_yolu);
$buyuk = $handle->file_dst_name; // BUYUK HALI
$handle->file_new_name_body = $sifrele;
$handle->file_auto_rename = true;
$handle->image_resize = true;
$handle->image_ratio_crop = 'C';
$handle->image_x = 380;
$handle->image_y = 210;
$handle->mime_check = true;
$handle->image_convert = 'jpg';
$handle->jpg_quality = 75;
$handle->Process($dosya_yolu);
$kucuk = $handle->file_dst_name; //KUCUK HALI
} else {
//hata kodu
}
if ($handle->processed) {
$kayit =$db->prepare("INSERT INTO foto_tablon(resim) VALUES(?)");
$kayit->execute([$buyuk]);
echo '<img src="img/'.$buyuk.'">';
} else {
echo $handle->error ;
}
}
}
?>
</body>
</html>
bekle halledeyım bır ornek
artık bir alan adına yanlızca 1 defaya mahsus ucretsız ssl alabılırsın dıyor
1 alan adın var ıse ssl al gıtsın ugrasma yok cok alan adım var dersen cyberpanel lı hostlarda bu ozellık sınırsız mevcut
kullanan sıtelere baktıgımda benım sunucudan bıle daha hızlı calsıtıgını goruyorum
digitalocean var tayfununda videosu var buna ait ama hep localde calısan versıyonu kımse hostta nasıl entegre edılır yazmamıs
tayfun belkı sıfırdan nasıl host edılır dıye vıdeo cekebılır bızde faydalanırız :)
verot upload kullanmalısın sonra hack yeme
https://www.verot.net/php_class_upload.htm
http://www.erbilen.net/verot-net-upload-sinifi-kullanimi/
verot kodlarını sısteme dahıl et sonra bunu kullan
// as it is multiple uploads, we will parse the $_FILES array to reorganize it into $files
$files = array();
foreach ($_FILES['gorsel'] as $k => $l) {
foreach ($l as $i => $v) {
if (!array_key_exists($i, $files))
$files[$i] = array();
$files[$i][$k] = $v;
}
}
// now we can loop through $files, and feed each element to the class
foreach ($files as $file) {
// we instanciate the class for each element of $file
$handle = new Upload($file);
// then we check if the file has been uploaded properly
// in its *temporary* location in the server (often, it is /tmp)
if ($handle->uploaded) {
// now, we start the upload 'process'. That is, to copy the uploaded file
// from its temporary location to the wanted location
// It could be something like $handle->process('/home/www/my_uploads/');
$handle->process($dir_dest);
// we check if everything went OK
if ($handle->processed) {
// everything was fine !
echo '<p class="result">';
echo ' <b>File uploaded with success</b><br />';
echo ' File: <a href="'.$dir_pics.'/' . $handle->file_dst_name . '">' . $handle->file_dst_name . '</a>';
echo ' (' . round(filesize($handle->file_dst_pathname)/256)/4 . 'KB)';
echo '</p>';
} else {
// one error occured
echo '<p class="result">';
echo ' <b>File not uploaded to the wanted location</b><br />';
echo ' Error: ' . $handle->error . '';
echo '</p>';
}
} else {
// if we're here, the upload file failed for some reasons
// i.e. the server didn't receive the file
echo '<p class="result">';
echo ' <b>File not uploaded on the server</b><br />';
echo ' Error: ' . $handle->error . '';
echo '</p>';
}
$log .= $handle->log . '<br />';
}
bir makalede php realtime işlemlerin yakında mümkün olacağından bahsediliyordu. ( php ekibinden bir bro yazmış :)