April 18, 2011

How to limit browse button to valid image files only

Question by sandeep

I want that whenever we click on browser button to upload so only image file is comes automatically instead of other file extension

Answer by Starx

You cannot restrict the upload, with just using HTML. There are two ways AFAIK

  • Read the file types and deny, after the form is submitted at the back end.
  • Use plugins like uploadify to restrict while selecting the file

Author: Nabin Nepal (Starx)

Hello, I am Nabin Nepal and you can call me Starx. This is my blog where write about my life and my involvements. I am a Software Developer, A Cyclist and a Realist. I hope you will find my blog interesting. Follow me on Google+

...

Please fill the form - I will response as fast as I can!