Hi,
Very new to PHP and am enjoying learning the ins and outs etc, but while creating my mam a website, ive ran into a problem while uploading, resizing and saving the file to my web host. Initially i used imagecreatefromjpeg, but this was taking too much memory up, so opted to use imagemagick. All of the features work apart from the file getting saved to the uploads directory on my web space. They always get saved to the root. If someone could help i would be very grateful. The code ive got currently is:
<?php
// If the form has been submitted do this
if(isset($_POST['submit'])) {
// Temporary upload image name
$original_image = $_FILES['photo']['tmp_name'];
// Get the image dimensions
$size=GetImageSize( $original_image );
// Name to save the image as - in this case the same as the original
$new_image = $_FILES['photo']['name'];
// Maximum image width
$max_width = "600";
// Maximum image height
$max_height = "300";
// Resize the image and save
exec("convert -size {$size[0]}x{$size[1]} $original_image -thumbnail $max_widthx$max_height $new_image");
echo "File uploaded<br>";
echo "<img src=\"".$new_image."\">";
}
?>
Hopefully someone could help
Many thanks,
Matk.