I've a dropdownlist with 3 items like Images,Videos and Documents and fileupload control.When selected an item in dropdownlist for eg. If Images item selected,the file to upload shd be an jpg,png,giff  extension otherwise invalid filetype shd be the error msg. likewise for Document accepts only .doc,.docx,pdf etc.
Can someone help me to get me the approach,i've attached my sample code.but it's just accepting all file type i need it to be more precise like wht i've explained.
 
protected void btnUpload_Click(object sender, EventArgs e) { if (Page.IsPostBack) { Page.Validate(); if (Page.IsValid == true) { string filename; //filename = Path.GetFileName(FileUpload1.PostedFile.FileName); string filepath = "~/" + "PERLSPROJECT/" + DropDownList1.SelectedItem.Value + "/" + Path.G ...

Go to the complete details ...