In our web based application we allow users to upload files.
I wonder if after clicking browse button we can restrict the list of available files to be uploaded by file extension. *.zip for example. Just to give the user easier way to find, select and click the file name.
I guess there will be javascript base solution but can I do it without javascript?
NOTE: this questions is only about making the browse dialogue to display less files.
In theory,
<input type="file" accept="application/zip">should work. Sadly, no mayor browser supports it…You can use JavaScript to allow zip files only, but they will still appear in the list.
Edit:
For restriction purposes, you could use JavaScript, but you’d still have to perform server-side verification (with PHP, for example).
For a more convenient dialogue, you could use a Flash or Java Applet solution.
Links:
Flash Uploader
JUpload
Both allow you to limit the file extensions (among many other customizations).