javascript - Limit File Types Shown in Browse Window -
is there no way @ limit file types shown in browse file window? tried this:
<input type="file" accept="text/xml" name="parameter_file" />
firefox, ie ignore it. found below excerpt question:
accept attribute introduced in rfc 1867, intending enable file-type filtering based on mime type file-select control. most, if not all, browsers make no use of attribute.
how else can this? know can achieve flash don't want use flash.
i checking selected file type on server side improve user experience making easier show xml files.
thanks help.
afaik, there no way this. next best thing use js check file extension before form submitted user won't waste time uploading file not accepted, server-side file type check routine should kept, because first method bypassed turning js off.
here's jquery solution: how have jquery restrict file types on upload?
hope helps.
Comments
Post a Comment