Posted by macca on 10/25/07 18:44
Try someting like this maybe... (untested)
//move the image
if(!is_file("$image_destination/$picture_name")){
move_uploaded_file($_FILES[$form_fieldname]
['tmp_name'],$image_destination.'/'.$_FILES[$form_fieldname]
[$picture_name]);
} else {
//An image with that name already exists so remove
it
unlink("$image_destination/$picture_name");
move_uploaded_file($_FILES[$form_fieldname]['tmp_name'],
$image_destination.'/'.$_FILES[$form_fieldname][$picture_name]);
}
[Back to original message]
|