1
Software / Imagemagick
« on: August 25, 2005, 06:37:01 am »
Hi
I have the following code, but cant get the file to save to the server path:
What am I doing wrong?
Thnx!
I have the following code, but cant get the file to save to the server path:
Code: [Select]
foreach ($_FILES["myfiles"]["error"] as $key => $error) {
if ($error == UPLOAD_ERR_OK) {
$tmp_name = $_FILES["myfiles"]["tmp_name"][$key];
$name = $_FILES["myfiles"]["name"][$key];
$size = getimagesize ($tmp_name);
$path= "/temp";
if (($size[0] >= 300) or $size[1] >= 200) {
$ratio = $size[0] / 300;
$newx = 300;
$newy = $size[1] / $ratio;
$mogrify="/usr/bin/mogrify";
$size = $newx."x".$newy;
$result="$mogrify -size $size $path/$name -resize $size +profile \"*\"";
exec($result);
}
}
}
What am I doing wrong?
Thnx!