Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jun 2005
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question regarding file uploads

    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

  • #2
    Regular Coder
    Join Date
    Sep 2004
    Posts
    202
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #3
    Regular Coder
    Join Date
    Apr 2005
    Location
    Lisbon, CT
    Posts
    339
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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/ht.../inputfile.htm

    BaldEagle


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •