
December 9th, 2012, 07:08 PM
|
 |
Contributing User
|
|
Join Date: Nov 2012
Posts: 98
Time spent in forums: 1 Day 2 h 20 m 38 sec
Reputation Power: 1
|
|
|
Image replacement, with move_uploaded_file
Hi All,
I'm having trouble with some code.
PHP Code:
//This is the directory where images will be saved
$targetPic = "./inv_Pictures/";
$targetPic = $targetPic . basename($_FILES['picture']'name']);
$picture=($_FILES['picture']['name']);
move_uploaded_file ($_FILES['picture']['tmp_name'], './inv_Pictures/'.$_POST['mdl_key'].'.jpg' );
This code is run when POST form is submitted. This form DOES work when I have no image for the record with (mdl_key) but when there is already an image and I try to use the form to replace that image, it does not change after submission, it just stays the same picture.
Any ideas?
Thanks!
|