I want to show multiple file type option when upload the files.
I refer to this: http://jsfiddle.net/dirtyd77/LzLcZ/144/ .
It works great when only one type of file is appear on the option.
<p>Only show Excel (.xlsx) files...</p> <input type="file" accept="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" ID="fileSelect" runat="server" />
but it will show 'Custom Files' when it has multiple options. as shown in image below.
<p>Show .xls, .xlsx, .csv files...</p> <input type="file" accept=".csv, .pdf" ID="fileSelect" runat="server" />
Is there any way to show multiple options (1row for PDF, 1row for image, 1row for Excel, etc) in the file type dropdown menu? Instead of showing 'Custom Files'?
The accept attribute specifies a filter for what file types the user can pick from the file input dialog box. Note: The accept attribute can only be used with <input type="file"> . Tip: Do not use this attribute as a validation tool. File uploads should be validated on the server.
Tip: For <input type="file"> : To select multiple files, hold down the CTRL or SHIFT key while selecting. Tip: For <input type="email"> : Separate each email with a comma, like: [email protected], [email protected], [email protected] in the email field.
The accept attribute is incredibly useful. It is a hint to browsers to only show files that are allowed for the current input .
HTML | <input> multiple Attribute The HTML <input> multiple Attribute is a Boolean Attribute. It specifies that the user is allowed to select more than one value that presents in an element.
hi i have tried this and worked
the problem was the space you have given between the .csv, .pdf as i thought
<p>MY CUSTOM ONE</p> <input type="file" accept="image/*,video/*,.pdf,.csv" ID="fileSelect" runat="server" />
here is your updated fiddle work
DEMO code working
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With