I'm using this script for multiple image upload, but I want to resize each images uploaded through the form so that the maximum height and width should be 500px, without loosing the proportions. Here is the script:
PHP Code:
while(list($key,$value) = each($_FILES['images']['name']))
{
if(!empty($value))
{
$filename = $value;
$filename=str_replace(" ","_",$filename);// Add _ inplace of blank space in file name, you can remove this line
while(file_exists('upimg/'.$filename))
$filename=rand(1,9999).$filename;
$add = "upimg/$filename";
//echo $_FILES['images']['type'][$key];
// echo "<br>";
copy($_FILES['images']['tmp_name'][$key], $add);
chmod("$add",0777);
}
Can anyone please help?
Thanks in advance
|