Jump to content


Photo

Error moving converted image on webserver


  • Please log in to reply
No replies to this topic

#1 nickd_101

nickd_101
  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 20 October 2006 - 05:08 PM

Hi,
I've developed a website on a local PHP server, and have just uploaded it to my webspace. I have a script that resizes and uploads images to the server for display on various articles. However, when a user uploads an image file the following error is displayed:

Warning: move_uploaded_file(images/user/johnny.JPG): failed to open stream: Permission denied in /home/onestops/public_html/add_property.php on line 131

Warning: move_uploaded_file(): Unable to move '/var/tmp/phpvK4cZK' to 'images/user/johnny.JPG' in /home/onestops/public_html/add_property.php on line 131

The corresponding code is:

$imagedetails= "main";
$image_caption = $_POST['image_caption'];
$image_username = $Property_ID;
$image_tempname = $_FILES['image_filename']['name'];
$today = date("Y-m-d");
//upload image and check for image type
$ImageDir ="images/user/";

$ImageThumb = $ImageDir . "thumbs/";

$ImageName = $ImageDir . $image_tempname;
if (move_uploaded_file($_FILES['image_filename']['tmp_name'], $ImageName)) {
//get info about the image being uploaded
list($width, $height, $type, $attr) = getimagesize($ImageName);

Can anyone see any solutions to the problem, as i've had help from the space provider (startlogic) but i can't see any problem with the code?

Thanks for the help,
Nick




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users