I have an edit form that I use to edit records in the database, and when I edit some files, I add a photo to the database. Also, when I do this, I have in my script to copy the photo to a certain location...this doesn't work in my update script.
BUT, this same operation works in my add script. So, I am stumped...below is my code, let me know what you think:
$sql = "insert into stories
(pubdate,pub,section,page,series,keywords,headline,byline,intro,bodytext,photocredit,caption,custom5,custom4,custom3,web,featuremark,centerpiece)
values('$pubdate','$pub','$section','$page','$series','$keywords','$headline','$byline','$intro','$bodytext','$photocredit','$caption','$custom5','$custom4','$custom3','$web','$featuremark','$centerpiece')";
if ($custom3 == TRUE){
exec("cp $custom3 /tmp/$custom3");
$tmpimg = "/tmp/$custom3";
$newfile = "/projects/sunarchive/htdocs/image/";
$newphoto = "$newfile$result'.jpg'";
$newphoto2 = "$result.jpg";
$new_w=140;
$new_h=191;
system("convert -quality 80 -antialias -sample '$new_wx$new_h' '$tmpimg' '$newphoto'");
unlink ($tmpimg);