Standard File dialog filters
Moderator: General Moderators
Standard File dialog filters
I need to display a standard file dialog which can allow me to browse in files. I do use input type = file, such that a standard file dialog is displayed. But the filter is defaulted to "All files". I want to chnage it to "Picture files". Any suggestions.
try something like this
Just change the MIME type to suit.
You can add multiple MIME types separated by a comma.
Unfortunatley, most modern browsers ingnore the accept= parameter. As a suggestion, you could code this function into the upload script to screen for file type, if the file is an picture file then go ahead and accept it, if it isn't a picture file then spit out a message that only picture files are accepted for upload.
Mark
Code: Select all
<input name="file" type="file" accept="image/gif">You can add multiple MIME types separated by a comma.
Unfortunatley, most modern browsers ingnore the accept= parameter. As a suggestion, you could code this function into the upload script to screen for file type, if the file is an picture file then go ahead and accept it, if it isn't a picture file then spit out a message that only picture files are accepted for upload.
Mark