title: How to upload only csv files into the server in Java
body: <p>I have an application in which there is a requirement of Uploading csv files.</p>
  
  <p>Everything is working fine. I am uploading files successfully with extension <strong>.csv</strong>.</p>
  
  <p>Now here is the problem. someone may try to upload <strong>exe</strong> file  by changing its extension to <code>.csv</code> and upload to server. It is perfectly uploading. Some one suggested me to upload file by using <code>mimetype</code>. I follow <a href="http://www.rgagnon.com/javadetails/java-0487.html" rel="nofollow">this</a> tutorial. </p>
  
  <p>I am getting mimetype <code>null</code> for csv files.</p>
  
  <p>So can you please help me how to upload only csv files.</p>
  
  <p>Thanks in Advance</p>