Sir,
I have created an application that has Fileupload control on a page. Now I have allowed only .jpg , .jpeg & .pdf files to be uploaded in Fileupload Control. Therefore I have used regular expression, but that dosen't solved my problem. As a user can change extension of file to jpg or to pdf. Therefore I would want to validate uploaded file using the MAGIC NUMBERS. The magic numbers for .jpg & .jpeg files are (ff d8 ff) & for pdf is (%PDF).