UPLOADING and RENAMING FILES PROBLEMS, PLEASE HELP
Posted: Sat Nov 30, 2002 3:45 pm
Im try to upload files and text of a form. From that form i mix post and files. what i am trying to do is upload a file and have it named to one of the fields of the post.
For example.
I have a text box with name id, and a file box for an image named thumb_img for the uploading
my code in the php upload script is as follows for the uploading of the file and renaming.
copy($_FILES[thumb_img][tmp_name], "/home/webtemp/public_html/images/t/thumbs/".$_FILES[thumb_img][name])
rename("/home/webtemp/public_html/images/t/thumbs/".$_FILES[thumb_img][name], "/home/webtemp/public_html/images/t/thumbs/".$_POST[id].".gif");
or die("Couldn't copy the thumb image file");
Can someone please, I been stuck with this problem for awhile.
Thank you
- urb -
For example.
I have a text box with name id, and a file box for an image named thumb_img for the uploading
my code in the php upload script is as follows for the uploading of the file and renaming.
copy($_FILES[thumb_img][tmp_name], "/home/webtemp/public_html/images/t/thumbs/".$_FILES[thumb_img][name])
rename("/home/webtemp/public_html/images/t/thumbs/".$_FILES[thumb_img][name], "/home/webtemp/public_html/images/t/thumbs/".$_POST[id].".gif");
or die("Couldn't copy the thumb image file");
Can someone please, I been stuck with this problem for awhile.
Thank you
- urb -