How to upload pdf file only
<p>I want to upload pdf only not doc file if i use javascript code it will accept doc file
also</p>

<pre><code>function CheckFile()
{
    var file = document.getElementById('FileUpload1');
    var len=file.value.length;
    var ext=file.value;
    if (file.value.length &lt;= 0)
    {
        alert('Please select a file to import');
        document.getElementById('FileUpload1').focus();
        return false;
    }
    else if (ext.substr(len-3,len)!="pdf" )
    {
        alert("Please select a  pdf file ");
        return false;
    } 
} 
</code></pre>
