...

View Full Version : Question regarding file uploads



rcampbell12
06-02-2005, 01: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.

Russell

NeilKelty
06-04-2005, 03: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.

BaldEagle
06-04-2005, 05: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:
http://www.blooberry.com/indexdot/html/tagpages/i/inputfile.htm

BaldEagle



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum