Posted on: 4/1/2014 4:51:17 AM | Views : 1059

I have a file upload control and I want users to upload only .wav and .mp3 audio files. I am checking ContentType of the uploaded file to acheive this. Below is my code. The problem is when I downloaded some test mp3 files from internet initilally the content type was audio/mp3  and everything was working fine. Now suddenly when I try to upload the same file the content type is coming as "audio/mpeg". Which content type should I check?(both??). Similarly for .wav files, intially it was audio/wav now it is coming as audio/x-wav. I am really confused about what content type to check for audio mp3/wav files. Any help is appreciated.

                if (audioControl.PostedFile.ContentType == "audio/wav" || audioControl.PostedFile.ContentType == "audio/mp3")                 {
Go to the complete details ...