I have been having a weird prob with some file uploads that I have been trying to do for one site. I have been using some code from previous work I have done. I have read throught the article and some past posts and cant find my problem. I chmodded the directory that the files are uploading too.
here is the code that i have been dealing with:
function add_submit($sm_img)
{
// upload the small image and get its name and stuff
if (isset($sm_img)) {
if (copy("$sm_img", "/home/sites/site2/web/images/gallery/pieces/$sm_img_name")) {
print ("");
} else {
print ("There was no small image uploaded <br>\n");
}
unlink($sm_img);
} else {
print ("The sm img was not uploaded. <BR>\n");
print ("Go <a href=\"index.html\">here</a> to try again.\n");
} // end small image upload
}
I hate to be such a pain by askign about bugs but this one baffles me.
I get errors like:
Warning: Unable to open '/whatever/entanglementsm.jpg' for reading: No such file or directory in
templates/piece_submit.php on line 208
There was no small image uploaded
Warning: Unlink failed (No such file or directory) in piece.php on line 214