I am working on a form that takes some text inputs and two files.
1 file is an image, and the other is an .mp3
The script works fine up to uploading the Image file... but it doesn't upload the .mp3 any idea what I'm doing wrong?
<form id="performer" name="performer" action="add.php" method="post" enctype="multipart/form-data">
<input id="image" name="ufile" type="file" />
<input id="music" name="ufile" type="file" />
<input type="submit" name="submit" value="Upload" />
the PHP script above was simplified A LOT but i know the problem lies somewhere in the lines posted and not in the ones I took out (like the extension checks) because If there is no file or the extension is wrong it wont even attempt to upload the file thus I would get a custom error message instead of the one I am getting.
//set the different directories
$image_dir = '../../info/images/';
$music_dir = '../../info/music/';
//set $image / $music to file destination
//set $image_tmp / $music_tmp to file's upload name
$image_name = basename($HTTP_POST_FILES['ufile']['name']);
$image_tmp = $HTTP_POST_FILES['ufile']['tmp_name'];
$image = $image_dir . basename($HTTP_POST_FILES['ufile']['name']);
$music_name = basename($HTTP_POST_FILES['ufile']['name']);
$music_tmp = $HTTP_POST_FILES['ufile']['tmp_name'];
$music = $music_dir . basename($HTTP_POST_FILES['ufile']['name']);
//move image to its destination
//move music to its destination
The error i'm getting refers to the variable $music_tmp where it is on the LAST LINE above.
I know the file is being uploaded because I test for a .mp3 extension on the $HTTP_POST_FILES['ufile']['name'] array and the test returns that it is an .mp3 extension....
An error occurred in script '/home2/stillfri/public_html/stevefest/admin/band/add.php' on line 107: copy() [function.copy]: Filename cannot be empty Array
which means at least the file name is getting to the server...
I don't know... does anyone have any ideas. I've read like 20 different multiple file upload tutorials and my syntax matches the ones in the tuts (so don't bother linking me to any tutorials please and thanks)