I'm having some trouble with uploading files. I have a form that I'm using to upload two files at once, an image and a thumbnail of that image. The code I used in the upload form is as follows:
<form method="post" ENCTYPE="multipart/form-data" action="addtosql.php3">
<INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="300000">
full-size image<br><input type=file name=userfile size=30>
<br><br>
thumbnail image<br><input type=file name=userthumb size=30>
... some other fields ...
</form>
The code in addtosql.php3 which processes these images is as follows:
copy($userfile,"$gallery/" . "$userfile_name");
copy($userthumb,"$gallery/thumbnails/" . "$userthumb_name");
The first full-size image is uploading with no problems. However, for some reason it's copying the full size image to the thumbnail image. So th_filename is not being created as the thumbnail image, but rather as the full size image.
I'm suspecting it has something to do with the fact that I have two files uploading from one form.
If anyone has ideas/suggestions, I'd be very grateful! Thanks!