By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,350 Members | 1,304 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,350 IT Pros & Developers. It's quick & easy.

Image upload problem

P: n/a
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_FILES['product']['name'][$i];
$newfile = $path . "images/" . $id . ".jpg";

move_uploaded_file($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_FILES 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
Jul 17 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.