View Full Version : Question regarding file uploads

06-02-2005, 02:01 AM
Using the file upload feature in HTML <input type="file">, I'd like to have the dialog that comes up filter to XLS file types, but this doesn't really seem to be a possibility in HTML. JavaScript, perhaps? Or another way? Any suggestions would be appreciated.


06-04-2005, 04:02 PM
Well I would think that you could set a JavaScript that would go from the end and stop and the 1st . and then get that extension and if it was .xls then it would not allow the form to submit, and a alert box would pop up and say not allowed. I can't remember the command right off the top of my head..(still not great a JavaScript.

06-04-2005, 06:07 PM
There is an attribute: "accept="xls,doc,ppt" for use with the input type=file.

I have never used it, never tested it and do not know how well it is supported.

Go here for more info: