I have two file upload forms. On the first i upload images and limit the file types to .jpg and .png with the following line of code:
$type = $_FILES['userfile']['type'];
if (($type == 'image/png') or ($type == 'image/pjpeg'))
//assign file location etc
On the second upload form, i wish to allow the user to upload audio content. I would like to limit this content to .wma and .mp3. When attempting to upload the audio file for test purposes, so that i could retrieve the file type (ie: audio/wma or something of the like) i used the following lines of code:
$type = $_FILES['userfile']['name'];
echo $type;
this returns a null.
Is there a file type associated with audio files? If so what is it and what am i doing wrong?
If not then how can i limit my users to .wma and .mp3 files?