Image upload problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • William Holroyd

    Image upload problem

    Hi all,

    I'm having a problem with one of my scripts that is baffling me. I've
    already looked at other's coding for image uploads, but i still can't get
    this to work...



    if ($image) {

    echo "Image exists";

    $path = "/home/web/union/computerstore/testing/final/";

    $tmpfile = $path . $HTTP_POST_FILE S['product']['name'][$i];
    $newfile = $path . "images/" . $id . ".jpg";

    move_uploaded_f ile($HTTP_POST_ FILES['product']['tmp_name'][$i],
    $tmpfile);
    chmod($newfile, 0664);
    exec("/usr/bin/convert $newfile -scale 200x200 $newfile");

    }



    The submitting form has multiple uploads, and so this code is within a
    'while' statement to loop through and process each one of them.

    $image returns true because "Testing" is outputed, I can also echo
    $HTTP_POST_FILE S or any other variable used in the if statement, but as far
    as simply moving the file, this is where it doesn't work.

    There are no errors or warnings reported whatsoever either.

    PHP 4.3.4 & Apache 2.0.48

    Any help would be appreciated.

    William


Working...