/    Sign up×
Community /Pin to ProfileBookmark

setting a file mask for a file uploading input tag

Hello

I was wondering whether it is possible to set a file mask for the file selection dialog window that is opened when the <input type=”file”> tag is used.

When opening the file selection dialog, the default should be ‘Photo files’ (and the mask should include *.bmp, *.jpg, *.jpeg, *.jpe, *.png, *.gif, etc). ‘All files (*.*)’ should be second choice and there should be no selection choice for HTML

The default mask is:
‘All files (*.*)’
‘Pictures (*.gif, *.jpg)’
‘HTML (*.htm, *.html)’

thanks in advance

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@KorJul 07.2004 — I am affraid javascript can not do that (at least not alone) as the upload mask is in fact an Operating System behaviour (not even a browsers's)

You may try a Java based application , see at:

http://www.infomentum.com/appletfile/doc/docs/index.htm
×

Success!

Help @davidklonski spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.25,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...