mam mensi problem. potrebujem na server nahravat obrazky (menim aj velkost). to samo o sebe nie je problem, no potrebujem ich ukladat pod inym nazvom. napr.: uzivatel ho ma ulozeny na svojom PC pod nazvom picture.jpg a ja ho potrebujem ulozit pod nejakym ID (napr.:"pc_147.jpg").
obrazky nahravam cez:
Kód:
<?php
$uploadedfile = $_FILES['uploadfile']['tmp_name'];
$src = imagecreatefromjpeg($uploadedfile);
list($width,$height)=getimagesize($uploadedfile);
$newwidth=600;
$newheight=($height/$width)*600;
$tmp=imagecreatetruecolor($newwidth,$newheight);
imagecopyresampled($tmp,$src,0,0,0,0,$newwidth,$newheight,$width,$height);
$filename = "imgs/". $_FILES['uploadfile']['name'];
imagejpeg($tmp,$filename,100);
imagedestroy($src);
imagedestroy($tmp);
?>
(overenie pripony a pod. nie je problem)
DIK.